In jenkins-support
script there is this section that copies over files under the ref directory.
if [[ ! -e $JENKINS_HOME/${rel} || $f = *.override ]]
then
action="INSTALLED"
log=true
mkdir -p "$JENKINS_HOME/${dir:23}"
cp -r "${f}" "$JENKINS_HOME/${rel}";
else
action="SKIPPED"
fi
I am extending the base lts-alpine
container with some init.groovy.d
scripts.
I have a few init.groovy.d
scripts that configure agents/jobs/credentials. If I add new logic to one of these files it is not copied over because the file already exists.
I think it would be better for these files/directories to be managed through a hash comparison as these files do not have a version value like the plugins do.
As a work around I am making a symlink for each file so that the file gets linked to the original file.
# Make a .override file for each file so it copies it over upon jenkins startup.
RUN find /usr/share/jenkins/ref/init.groovy.d -type f -exec ln -s '{}' '{}'.override \;
Updated files are not copied over.
Updated files are copied over.
existing files are not copied over to prevent overriding changes made through the web ui
I think this could be closed. I do not see an easy way to handle this that could be handled at the level of the Jenkins Docker image.
Or @arthurvanduynhoven if you have an idea to be able to differentiate files changed/used by the user and things that were not and that upgrading the image should update, please provide your thoughts.
Closing as per my last comment. Feel free to reopen once/if you think there's a way to handle this. Thanks