aboutsummaryrefslogtreecommitdiffstats
path: root/.extras/image-builder/bootstrap.sh
diff options
context:
space:
mode:
Diffstat (limited to '.extras/image-builder/bootstrap.sh')
-rwxr-xr-x.extras/image-builder/bootstrap.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/.extras/image-builder/bootstrap.sh b/.extras/image-builder/bootstrap.sh
index e9d9be5..9893e66 100755
--- a/.extras/image-builder/bootstrap.sh
+++ b/.extras/image-builder/bootstrap.sh
@@ -521,9 +521,18 @@ LABEL slackware.arch="x86_64"
CMD ["/bin/bash"]
DOCKERFILE
+ # Explicit exit checks: build_variant runs in an `if ! (...)` condition
+ # (see Main), which suppresses `set -e` in this subshell, so a failed build
+ # would otherwise push a nonexistent tag and log "Done".
_log "Building and pushing ${TAG}..."
- docker build --no-cache -t "${TAG}" "${WORKDIR}"
- docker push "${TAG}"
+ if ! docker build --no-cache -t "${TAG}" "${WORKDIR}"; then
+ _warn "build failed for ${TAG}; not pushing."
+ return 1
+ fi
+ if ! docker push "${TAG}"; then
+ _warn "push failed for ${TAG}."
+ return 1
+ fi
_log "=== Done: ${TAG} ==="
}