summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-05-14 15:21:48 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-05-15 14:25:24 +0200
commitbcd4332b6b1163c4033f62fa2c72a349ef2e04a1 (patch)
tree4936d7ad9f25b218bc07bf55e0c4848413ba6e85 /contrib
parente44a0cb0d91fb6fa543a3f6b83aae6ff5afbbcf9 (diff)
jenkins-run: clean up also upon error
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/jenkins-run.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/jenkins-run.sh b/contrib/jenkins-run.sh
index 87d29bf..3931ddb 100755
--- a/contrib/jenkins-run.sh
+++ b/contrib/jenkins-run.sh
@@ -16,10 +16,16 @@ rm *.md5
# OSMO_GSM_TESTER_OPTS is a way to pass in e.g. logging preferences from the
# jenkins build job.
-python3 -u "$(which osmo-gsm-tester.py)" "$trial_dir" $OSMO_GSM_TESTER_OPTS
+# On failure, first clean up below and then return the exit code.
+exit_code="1"
+if python3 -u "$(which osmo-gsm-tester.py)" "$trial_dir" $OSMO_GSM_TESTER_OPTS ; then
+ exit_code="0"
+fi
# no need to keep extracted binaries
rm -rf "$trial_dir/inst" || true
# tar up all results for archiving (optional)
tar czf "$trial_dir"-run.tgz "$trial_dir"
+
+exit $exit_code