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
This commit is contained in:
Oliver Smith 2024-04-03 11:55:51 +02:00 committed by osmith
parent c1056236b5
commit 363e268cdc
1 changed files with 4 additions and 1 deletions

View File

@ -386,7 +386,10 @@ fix_perms() {
-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() {