Skip to content

Commit f5fd303

Browse files
author
Andy Hibbert
committed
PRE_CLEAR_INIT_GROOVY_D:
Change-Id: I79bb00935a8d4a28a5e5f8b24fc70aafbef38695
1 parent 7d1ab73 commit f5fd303

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ FROM jenkins/jenkins:lts
164164
COPY custom.groovy /usr/share/jenkins/ref/init.groovy.d/custom.groovy
165165
```
166166

167+
If you need to maintain the entire init.groov.d directory and have a persistent JENKINS_HOME you may run the docker image with `-e PRE_CLEAR_INIT_GROOVY_D=true`
168+
167169
## Preinstalling plugins
168170

169171
You can rely on the `install-plugins.sh` script to pass a set of plugins to download with their dependencies.

jenkins.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
: "${JENKINS_WAR:="/usr/share/jenkins/jenkins.war"}"
44
: "${JENKINS_HOME:="/var/jenkins_home"}"
5+
6+
if [[ -n "${PRE_CLEAR_INIT_GROOVY_D}" ]]; then
7+
rm -rf "${JENKINS_HOME}/init.groovy.d"
8+
fi
9+
510
: "${COPY_REFERENCE_FILE_LOG:="${JENKINS_HOME}/copy_reference_file.log"}"
611
: "${REF:="/usr/share/jenkins/ref"}"
712
touch "${COPY_REFERENCE_FILE_LOG}" || { echo "Can not write to ${COPY_REFERENCE_FILE_LOG}. Wrong volume permissions?"; exit 1; }

0 commit comments

Comments
 (0)