diff --git a/mailgun-webhook/build-image.sh b/mailgun-webhook/build-image.sh index 4401670..7a41675 100755 --- a/mailgun-webhook/build-image.sh +++ b/mailgun-webhook/build-image.sh @@ -2,14 +2,19 @@ if [ "$1" == "" ] ; then printf "\nYou did not specify the Docker image version to build" - printf "\n\nSyntax:\n\n build-image.sh 1.0.0\n\n" + printf "\n\nSyntax:\n\n build-image.sh 1.0.0 [--autopush]\n\n" exit 1 fi -read -p "BUILD: Push new image to registry [y/n]? " -n 1 -r -echo # (optional) move to a new line - -PUSH_IMAGE="$REPLY" +# Check for --autopush flag +if [ "$2" == "--autopush" ]; then + PUSH_IMAGE="y" + printf "\nAuto-push enabled. Image will be pushed to registry.\n" +else + read -p "BUILD: Push new image to registry [y/n]? " -n 1 -r + echo # (optional) move to a new line + PUSH_IMAGE="$REPLY" +fi printf "\nBUILD START ...\n\n"