Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | set -e -x |
| 3 | |
Neels Hofmeyr | c59e079 | 2017-05-14 01:57:25 +0200 | [diff] [blame] | 4 | # remove older trial dirs and *-run.tgz, if any |
| 5 | trial_dir_prefix="trial-" |
| 6 | rm -rf "$trial_dir_prefix"* || true |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 7 | |
Neels Hofmeyr | c59e079 | 2017-05-14 01:57:25 +0200 | [diff] [blame] | 8 | # Expecting *.tgz artifacts to be copied to this workspace from the various |
| 9 | # jenkins-*.sh runs, via jenkins job configuration. Compose a trial dir: |
| 10 | trial_dir="${trial_dir_prefix}$BUILD_NUMBER" |
| 11 | mkdir -p "$trial_dir" |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 12 | |
Neels Hofmeyr | c59e079 | 2017-05-14 01:57:25 +0200 | [diff] [blame] | 13 | mv *.tgz "$trial_dir" |
| 14 | cat *.md5 >> "$trial_dir/checksums.md5" |
| 15 | rm *.md5 |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 16 | |
Neels Hofmeyr | c59e079 | 2017-05-14 01:57:25 +0200 | [diff] [blame] | 17 | # OSMO_GSM_TESTER_OPTS is a way to pass in e.g. logging preferences from the |
| 18 | # jenkins build job. |
Neels Hofmeyr | bcd4332 | 2017-05-14 15:21:48 +0200 | [diff] [blame] | 19 | # On failure, first clean up below and then return the exit code. |
| 20 | exit_code="1" |
| 21 | if python3 -u "$(which osmo-gsm-tester.py)" "$trial_dir" $OSMO_GSM_TESTER_OPTS ; then |
| 22 | exit_code="0" |
| 23 | fi |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 24 | |
Neels Hofmeyr | c59e079 | 2017-05-14 01:57:25 +0200 | [diff] [blame] | 25 | # no need to keep extracted binaries |
| 26 | rm -rf "$trial_dir/inst" || true |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 27 | |
Neels Hofmeyr | c59e079 | 2017-05-14 01:57:25 +0200 | [diff] [blame] | 28 | # tar up all results for archiving (optional) |
| 29 | tar czf "$trial_dir"-run.tgz "$trial_dir" |
Neels Hofmeyr | bcd4332 | 2017-05-14 15:21:48 +0200 | [diff] [blame] | 30 | |
| 31 | exit $exit_code |