mirror of https://gerrit.osmocom.org/osmo-ci
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
This commit is contained in:
parent
d5e0fe011d
commit
0428da0f6d
|
@ -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 \
|
||||
|
|
Loading…
Reference in New Issue