osmith submitted this change.
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(-)
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 \
To view, visit change 30434. To unsubscribe, or for help writing mail filters, visit settings.