#/!bin/sh
defaultVersionValue=$(head -1 .version);
read -p "Enter Version : " version 
version=${version:-$defaultVersionValue}
echo "version : $version"

docker build -t registry.vnfco.ir/brizco/api:latest -t registry.vnfco.ir/brizco/api:$version . || exit 1;
docker push registry.vnfco.ir/brizco/api:latest ||  exit 1;
docker push registry.vnfco.ir/brizco/api:$version || exit 1;