diff options
Diffstat (limited to '.extras/image-builder/build-sbo-testbuild.sh')
| -rwxr-xr-x | .extras/image-builder/build-sbo-testbuild.sh | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/.extras/image-builder/build-sbo-testbuild.sh b/.extras/image-builder/build-sbo-testbuild.sh index 4364cd5..d04c426 100755 --- a/.extras/image-builder/build-sbo-testbuild.sh +++ b/.extras/image-builder/build-sbo-testbuild.sh @@ -104,10 +104,19 @@ DOCKERFILE local BUILD_FLAGS=() [[ "${FORCE}" == "true" ]] && BUILD_FLAGS+=(--no-cache) + # 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 ${TB_TAG}..." - docker build "${BUILD_FLAGS[@]}" -t "${TB_TAG}" "${WORKDIR}" + if ! docker build "${BUILD_FLAGS[@]}" -t "${TB_TAG}" "${WORKDIR}"; then + _warn " build failed for ${TB_TAG}; not pushing." + return 1 + fi _log " Pushing ${TB_TAG}..." - docker push "${TB_TAG}" + if ! docker push "${TB_TAG}"; then + _warn " push failed for ${TB_TAG}." + return 1 + fi _log "=== Done: ${TB_TAG} ===" } |
