Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/usr/share/jenkins/ref files not updated #618

Closed
arthurvanduynhoven opened this issue Dec 5, 2017 · 3 comments
Closed

/usr/share/jenkins/ref files not updated #618

arthurvanduynhoven opened this issue Dec 5, 2017 · 3 comments

Comments

@arthurvanduynhoven
Copy link

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 \;

Actual result

Updated files are not copied over.

Expected outcome

Updated files are copied over.

@carlossg
Copy link
Contributor

existing files are not copied over to prevent overriding changes made through the web ui

@batmat
Copy link
Member

batmat commented Sep 9, 2018

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.

@batmat
Copy link
Member

batmat commented Sep 12, 2018

Closing as per my last comment. Feel free to reopen once/if you think there's a way to handle this. Thanks

@batmat batmat closed this as completed Sep 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants