Search code examples
jenkinsgithubbitbucketchef-infrabcbsn

Chef Cookbooks: Installing Jenkins plugins from GItHub


I am using Chef to deploy my Jenkins instance. I am currently using the Jenkins cookbook found in the Chef Supermarket: https://supermarket.chef.io/cookbooks/jenkins .

I'm managing my plugins by adding them to the _master_war.rb recipe file. Most plugins I'm finding are straight forward, follow the specified instructions in the cookbook supermarket page and can be found for download on the https://wiki.jenkins-ci.org site with a link to a hpi/jpi file.

I'm finding some plugins which are only available via GitHub. For example, https://plugins.jenkins.io/workflow-cps. My current plugin code looks like thus:

# Installs the latest version of the workflow-job Plugin for Jenkins
# The BitBucket Build Status Notifier plugin is dependent on this plugin
# https://github.com/jenkinsci/workflow-job-plugin

jenkins_plugin 'workflow-job-plugin' do
  source 'https://github.com/jenkinsci/workflow-job-plugin.git'
  notifies :restart, 'runit_service[jenkins]', :immediately
end

Unfortunately, this syntax does not appear to install the plugin via git successfully on my jenkins instance. The following warning appears after running the recipe on the node jenkins is running on:

Bitbucket Build Status Notifier Plugin v1.3.3
    workflow-job v1.11 is missing. To fix, install v1.11 or later.
    workflow-cps v1.11 is missing. To fix, install v1.11 or later.
    multiple-scms v0.6 is missing. To fix, install v0.6 or later.

What would be the correct way / syntax to use to go about downloading and installing these plugins from github to my jenkins instance using the jenkins cookbook for Chef?


Solution

  • I would to to add to this discussion that I found a way to work through this issue. When a page like this one is the official source for a Jenkins plugin: plugins.jenkins.io/workflow-cps, on the right hand side of the screen is an 'Archives' link which will take you to the .hpi listing for all available versions of the given plugin. I.E. updates.jenkins.io/download/plugins/workflow-cps . Using the link address for the listed versions you can source the appropriate .hpi file