[MERGED] osmo-gsm-tester[master]: jenkins-run: clean up also upon error

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon May 15 12:47:06 UTC 2017


Neels Hofmeyr has submitted this change and it was merged.

Change subject: jenkins-run: clean up also upon error
......................................................................


jenkins-run: clean up also upon error

Change-Id: I949849d85d93cb47c839cd738788cf6f9b22fc12
---
M contrib/jenkins-run.sh
1 file changed, 7 insertions(+), 1 deletion(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



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 @@
 
 # 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

-- 
To view, visit https://gerrit.osmocom.org/2608
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I949849d85d93cb47c839cd738788cf6f9b22fc12
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list