diff options
author | Oliver Smith <osmith@sysmocom.de> | 2022-12-02 10:26:15 +0100 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2022-12-02 10:50:07 +0100 |
commit | 0428da0f6d35ae10aafb50cd4437b4c5149c579a (patch) | |
tree | 15ce12e584deb150b61c177a69c77d4d1e626cf0 | |
parent | d5e0fe011dfadc5b4b11b662e8522adc4594d5f1 (diff) |
jobs/osmo-gsm-tester virtual: fix permissions
The docker container creates the trial dir and some files inside of it
as root, therefore the rm -rf trial-* line fails. Add logic to fix the
permissions before attempting to remove old trial-* and when the script
exits.
Related: OS#5793
Change-Id: I91bd6656f33667f401247721bb34298a6c66fc62
-rw-r--r-- | jobs/osmo-gsm-tester-runner.yml | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/jobs/osmo-gsm-tester-runner.yml b/jobs/osmo-gsm-tester-runner.yml index 9a57ead..688da38 100644 --- a/jobs/osmo-gsm-tester-runner.yml +++ b/jobs/osmo-gsm-tester-runner.yml @@ -218,12 +218,35 @@ - timed: "H 22 * * *" builders: - shell: | - # make sure no test results/bin artifacts from a previous run remain - rm -rf trial-* *.tgz *.md5 + # make sure no bin artifacts from a previous run remain + rm -rf *.tgz *.md5 - copy_artifact_all - copy_artifact: repo: osmo-gsm-tester_build-osmocom-bb - shell: | + # Set a trap to fix workspace permissions on exit + fix_permissions() { + docker run --rm \ + -v "$WORKSPACE":/workspace \ + debian:bullseye \ + chmod -R a+rwX /workspace/ + } + fix_permissions_trap() { + set +x + echo + echo "### Clean up ###" + echo + set -x + + trap - EXIT INT TERM 0 + fix_permissions + } + trap fix_permissions_trap EXIT INT TERM 0 + + # Make sure no test results from a previous run remain + fix_permissions + rm -rf trial-* + # Build the docker image rm -rf docker-playground git clone \ |