From e417eea3321d0ced6c35e7d11594fdd9d317ab70 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Tue, 5 Mar 2024 13:59:12 -0600 Subject: [PATCH] Exit non-0 if docker build fails. --- .../data/container-build/cerc-nextjs-base/build.sh | 8 +++++++- .../data/container-build/cerc-webapp-base/build.sh | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/stack_orchestrator/data/container-build/cerc-nextjs-base/build.sh b/stack_orchestrator/data/container-build/cerc-nextjs-base/build.sh index cca8d64b..bb3983cf 100755 --- a/stack_orchestrator/data/container-build/cerc-nextjs-base/build.sh +++ b/stack_orchestrator/data/container-build/cerc-nextjs-base/build.sh @@ -11,8 +11,14 @@ CERC_CONTAINER_BUILD_DOCKERFILE=${CERC_CONTAINER_BUILD_DOCKERFILE:-$SCRIPT_DIR/D CERC_CONTAINER_BUILD_TAG=${CERC_CONTAINER_BUILD_TAG:-cerc/nextjs-base:local} docker build -t $CERC_CONTAINER_BUILD_TAG ${build_command_args} -f $CERC_CONTAINER_BUILD_DOCKERFILE $CERC_CONTAINER_BUILD_WORK_DIR +rc=$? -if [ $? -eq 0 ] && [ "$CERC_CONTAINER_BUILD_TAG" != "cerc/nextjs-base:local" ]; then +if [ $rc -ne 0 ]; then + echo "BUILD FAILED" 1>&2 + exit $rc +fi + +if [ "$CERC_CONTAINER_BUILD_TAG" != "cerc/nextjs-base:local" ]; then cat <&2 + exit $rc +fi + +if [ "$CERC_CONTAINER_BUILD_TAG" != "cerc/webapp-base:local" ]; then cat <