Skip to content

Commit f559d75

Browse files
authored
Merge pull request #900 from ac-hibbert/PRE_CLEAR_INIT_GROOVY_D
2 parents c02e403 + bd01eae commit f559d75

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
@@ -188,6 +188,8 @@ FROM jenkins/jenkins:lts-jdk17
188188
COPY --chown=jenkins:jenkins custom.groovy /usr/share/jenkins/ref/init.groovy.d/custom.groovy
189189
```
190190

191+
If you need to maintain the entire init.groovy.d directory and have a persistent JENKINS_HOME you may run the docker image with `-e PRE_CLEAR_INIT_GROOVY_D=true`
192+
191193
## Preinstalling plugins
192194

193195
### Install plugins

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

0 commit comments

Comments
 (0)