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

Ensure plugin download exec is idempotent #164

Closed
wants to merge 3 commits into from

Conversation

davidsnyder
Copy link

Since this is a blind exec, it's re-downloading the plugins every puppet run, which then triggers the jenkins service notify. This means that jenkins is needlessly restarted every time puppet agent runs, killing any currently running jobs. This skips the exec if the file already exists (only for .hpi)

@jenkinsadmin
Copy link

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@rtyler
Copy link

rtyler commented Aug 16, 2014

That's weird, I could have sworn this was protected by a creates parameter on the exec.

@igalic
Copy link
Contributor

igalic commented Aug 16, 2014

have you considered using @maestrodev's wget module instead?

@jchristi
Copy link
Contributor

The download is idempotent IF the installed version is the same as the specified version. We can not rely on the creates attribute because different versions will create the same file, which is why the jenkins_plugins fact was created. The idempotence of the same installed version is achieved with this line:

if (empty(grep([ $::jenkins_plugins ], $search))) {

This is verified in the rspec tests (spec/defines/jenkins_plugin_spec.rb).

@jchristi
Copy link
Contributor

That is to say, merging this change would break the ability to upgrade plugins.

@rtyler
Copy link

rtyler commented Sep 25, 2014

I think the right solution here might be to get my rtyler/jpm work properly squared away

@jhoblitt
Copy link
Member

jhoblitt commented May 4, 2015

I see that the cli has the ability to do plugin management, probably using the plugin manager exposed through the http interface (haven't checked the source). Does it not do something that's being done by puppet::plugin?

@jhoblitt
Copy link
Member

@davidsnyder We do appreciate your efforts! This issue should be resolved by #336, so I'm going to close out this pR.

@jhoblitt jhoblitt closed this Oct 10, 2015
@davidsnyder davidsnyder deleted the test-plugin-exists branch October 29, 2015 21:17
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

Successfully merging this pull request may close these issues.

6 participants