osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/30434 )
Change subject: jobs/osmo-gsm-tester virtual: fix permissions ......................................................................
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 --- M jobs/osmo-gsm-tester-runner.yml 1 file changed, 25 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/34/30434/1
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 \