From 3c505395685e96e88bb6746974587bc540be76fc Mon Sep 17 00:00:00 2001 From: Taka Date: Fri, 27 Mar 2020 20:43:35 +0000 Subject: [PATCH] Handle errors when building the Docker containers correctly. --- run-containers.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run-containers.sh b/run-containers.sh index 1e73da8..d07895f 100755 --- a/run-containers.sh +++ b/run-containers.sh @@ -147,7 +147,7 @@ if [ -z "$NO_BUILD" ]; then echo Building the \"$TAG\" containers... docker-compose build --build-arg ENABLE_TESTS=$ENABLE_TESTS 2>&1 \ | sed -e 's/^/ /' - if [ $? -ne 0 ]; then exit 10 ; fi + if [ ${PIPESTATUS[0]} -ne 0 ]; then exit 10 ; fi echo fi @@ -158,3 +158,4 @@ if [ -n "$ENABLE_TESTS" ]; then fi docker-compose up --detach 2>&1 \ | sed -e 's/^/ /' +exit ${PIPESTATUS[0]}