From 6cf9b312c0e2de2902250faddcaf8a1bab84eea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=87?= Date: Wed, 7 Jan 2026 12:51:41 +0100 Subject: [PATCH] feat: add --autopush flag to build-image.sh for non-interactive builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add optional --autopush parameter to skip the interactive push prompt and automatically push built images to registry. Useful for CI/CD pipelines and automated builds. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- mailgun-webhook/build-image.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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"