From 811ea3dc5fb90d09914cc4d47edc66c958ba9f3a Mon Sep 17 00:00:00 2001 From: valentinab25 <30239069+valentinab25@users.noreply.github.com> Date: Mon, 10 May 2021 14:42:47 +0300 Subject: [PATCH] move delete command before the chown command --- docker-entrypoint-dind.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker-entrypoint-dind.sh b/docker-entrypoint-dind.sh index 953e7c6..079fd62 100755 --- a/docker-entrypoint-dind.sh +++ b/docker-entrypoint-dind.sh @@ -4,6 +4,9 @@ if [ -e /var/run/docker.sock ]; then setfacl -m u:1000:rw /var/run/docker.sock fi +#clean up workspace, delete files older than 1day +find /var/jenkins_home/worker/workspace -maxdepth 1 -type d -ctime +1 -exec rm -rf {} \; + if [ -n "$DOCKERHUB_USER" ] && [ -n "$DOCKERHUB_PASS" ]; then SETTINGS_TPL='/tmp/settings.xml.j2' SETTINGS_FILE=$HOME'/.m2/settings.xml' @@ -16,7 +19,5 @@ if [ -n "$DOCKERHUB_USER" ] && [ -n "$DOCKERHUB_PASS" ]; then chown -R jenkins:jenkins /var/jenkins_home/worker/.docker fi -#clean up workspace, delete files older than 1day -find /var/jenkins_home/worker/workspace -maxdepth 1 -type d -ctime +1 -exec rm -rf {} \; exec /docker-entrypoint.sh "$@"