feat: add --autopush flag to build-image.sh for non-interactive builds
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user