osmith has submitted this change. ( 
https://gerrit.osmocom.org/c/docker-playground/+/36512?usp=email )

Change subject: jenkins-common: fix_perms: chown files too
......................................................................

jenkins-common: fix_perms: chown files too

Ensure the user that runs docker owns files in cache and data dirs
during fix_perms, if an old job created them as root.

Change-Id: I43af48bd87e27abad5ad52e734256d78651f67c3
---
M jenkins-common.sh
1 file changed, 16 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  pespin: Looks good to me, approved




diff --git a/jenkins-common.sh b/jenkins-common.sh
index 59224a0..f22158b 100644
--- a/jenkins-common.sh
+++ b/jenkins-common.sh
@@ -386,7 +386,10 @@
                        -v $CACHE_DIR:/cache \
                        --name ${BUILD_TAG}-cleaner \
                        "debian:$DEBIAN_DEFAULT" \
-                       chmod -R a+rX /data/ /cache/
+                       sh -e -x -c "
+                               chmod -R a+rX /data/ /cache/
+                               chown -R $(id -u):$(id -g) /data /cache
+                       "
 }

 collect_logs() {

--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/36512?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I43af48bd87e27abad5ad52e734256d78651f67c3
Gerrit-Change-Number: 36512
Gerrit-PatchSet: 4
Gerrit-Owner: osmith <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to