make build image only push if push is specified

This commit is contained in:
Nico Schottelius 2024-02-20 16:25:13 +09:00
parent dee2b1a90c
commit 26f3a1881d
1 changed files with 6 additions and 1 deletions

View File

@ -15,4 +15,9 @@ tag=${tagprefix}:${version}
set -ex
docker build -t "${tag}" .
docker push "${tag}"
push=$1; shift
if [ "$push" ]; then
docker push "${tag}"
fi