jenkins icon indicating copy to clipboard operation
jenkins copied to clipboard

Installing from hpi fails after first convergence

Open scottsuch opened this issue 9 years ago • 1 comments

I'm accessing jenkins_plugins resource via a wrapper cookbook. I'm attempting to install this plugin via hpi to enable VictorOps notifications. Everything converges properly on the first run of chef using the following block.

jenkins_plugin 'victorops' do
  source 'https://github.com/giancarlogarcia/jenkins-victorops-plugin/releases/download/v0.1/victorops.hpi'
end

However, every subsequent run produces a undefined method []' for nil:NilClass` error as seen in this gist.

The workaround is to add the version to the block like this:

jenkins_plugin 'victorops' do
  source 'https://github.com/giancarlogarcia/jenkins-victorops-plugin/releases/download/v0.1/victorops.hpi'
  version '0.1'
end

Corresponding stacktrace.out can be seen here.

scottsuch avatar Feb 08 '16 01:02 scottsuch

Just hit this as well ... This is because it's looking at plugin_universe to get the version, per https://github.com/chef-cookbooks/jenkins/blob/master/libraries/plugin.rb#L247

So it's looking at update center for a custom plugin that doesn't exist in the update center 😞 Other than unpacking the file, not sure how else it would get the version from the hpi to determine if it's desired version.

Brantone avatar Jul 19 '18 20:07 Brantone