Docker: init.groovy.d scripts not replaced/updated with changes

Created on 29 Aug 2017  路  4Comments  路  Source: jenkinsci/docker

Jenkins is running happily, with jenkins home mounted outside the container on a network share.
When upgrading the docker image to a new version with some changes to the init.groovy.d scripts, the scripts do not get updated in the jenkins home.

Actual result

Old scripts are run.

Expected outcome

The scripts should have been replaced in the jenkins home folder, so the updated scripts runs.

Have you tried a non-dockerized Jenkins and get the expected outcome?

Not relevant. Scripts work fine when creating a new container with a blank jenkins home

// Edit someone with the same issue:
https://stackoverflow.com/questions/45818327/jenkins-updating-init-groovy-d-files-in-a-docker-container

Most helpful comment

Ahh, I see now. I also noticed that *.override condition. If you look at the README, that appears to be the workaround.

In case you do want to override, append '.override' to the name of the reference file. E.g. a file named /usr/share/jenkins/ref/config.xml.override will overwrite an existing config.xml file in JENKINS_HOME.

All 4 comments

files that already exist are explicitly not overwritten to avoid overwritting UI changed configuration

https://github.com/jenkinsci/docker/blob/master/jenkins-support#L110

Ahh, I see now. I also noticed that *.override condition. If you look at the README, that appears to be the workaround.

In case you do want to override, append '.override' to the name of the reference file. E.g. a file named /usr/share/jenkins/ref/config.xml.override will overwrite an existing config.xml file in JENKINS_HOME.

solution provided

Was this page helpful?
0 / 5 - 0 ratings