From c7f3f572f4e904e9f490600cbd5bee836f86083e Mon Sep 17 00:00:00 2001 From: David Warburton Date: Mon, 22 Dec 2014 12:50:43 -0500 Subject: [PATCH] Fail the build if one step fails Setting this option in the bash script will cause the script to terminate if any of the commands returns a with non-zero value. This is necessary for the build server to understand when a build is failed. Without this flag, the script will exit with the status of the last command, which in this script is "echo" so it will be 0, regardless if a scons build step failed. Ideally we would try each step and then report the failures at the end, set -e will do the job until that can be developed. Change-Id: Ib6692d434a2e811f61d8dd1bff52766b7511abd7 Signed-off-by: David Warburton --- auto_build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/auto_build.sh b/auto_build.sh index 9f947eb..4edc0e0 100755 --- a/auto_build.sh +++ b/auto_build.sh @@ -1,5 +1,9 @@ #! /bin/bash +# Ideally we will capture the exit code of each step and try them all before failing +# the build script. For now, use set -e and fail the build at first failure. +set -e + function clean() { echo "*********** Clean build *************" -- 2.7.4