Skip to content

Commit

Permalink
move delete command before the chown command
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinab25 authored May 10, 2021
1 parent 8ff2e94 commit 811ea3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docker-entrypoint-dind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 "$@"

0 comments on commit 811ea3d

Please sign in to comment.