aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephane Desneux <stephane.desneux@iot.bzh>2018-07-04 14:30:28 +0200
committerStephane Desneux <stephane.desneux@iot.bzh>2018-07-04 14:30:28 +0200
commitc378b34f9e455aec054db824b90ec862aeac8f51 (patch)
treee94260820e2bff9752ef5a808bc30c0feba8e2ab
parent727b6e92389b6d75f119f9bf4718b22ebabb320c (diff)
setup_image.sh: exit with error in non interactive (=jenkins) mode
Change-Id: I282e80d0a5616c5a64019d6d9aba4611f3a922f5 Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
-rwxr-xr-xINSTALL/setup_image.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/INSTALL/setup_image.sh b/INSTALL/setup_image.sh
index 6acef66..ad79e10 100755
--- a/INSTALL/setup_image.sh
+++ b/INSTALL/setup_image.sh
@@ -18,13 +18,25 @@ function debug() {
set -x
return 0 # continue
}
+
+function crash() {
+ set +x
+ echo " -------------------------"
+ echo "| CRASH HANDLER TRIGGERED |"
+ echo " -------------------------"
+ exit 1
+}
+
# get the INSTALL dir (the one where we were launched)
INSTDIR=$(cd $(dirname $0) && pwd -P)
echo "Detected container install dir = $INSTDIR"
if [[ -f $INSTDIR/DEBUG ]]; then
- echo "#### DEBUG MODE IS ACTIVE ####"
+ echo "#### INTERACTIVE DEBUG MODE IS ACTIVE ####"
trap debug ERR # on error, run a sleep tp debug container
+else
+ echo "#### JENKINS MODE MODE IS ACTIVE ####"
+ trap crash ERR # on error, simply crash
fi