简体   繁体   English

Chef Cookbooks:从 GItHub 安装 Jenkins 插件

[英]Chef Cookbooks: Installing Jenkins plugins from GItHub

I am using Chef to deploy my Jenkins instance.我正在使用 Chef 来部署我的 Jenkins 实例。 I am currently using the Jenkins cookbook found in the Chef Supermarket: https://supermarket.chef.io/cookbooks/jenkins .我目前正在使用 Chef Supermarket 中的 Jenkins 食谱: https : //supermarket.chef.io/cookbooks/jenkins

I'm managing my plugins by adding them to the _master_war.rb recipe file.我通过将插件添加到 _master_war.rb 配方文件来管理我的插件。 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.我找到的大多数插件都很简单,按照食谱超市页面中的指定说明进行操作,可以在https://wiki.jenkins-ci.org站点上找到下载,并提供指向 hpi/jpi 文件的链接。

I'm finding some plugins which are only available via GitHub.我找到了一些只能通过 GitHub 获得的插件。 For example, https://plugins.jenkins.io/workflow-cps .例如, 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.不幸的是,此语法似乎无法在我的 jenkins 实例上通过 git 成功安装插件。 The following warning appears after running the recipe on the node jenkins is running on:在运行 jenkins 的节点上运行配方后,会出现以下警告:

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?使用 jenkins Cookbook for Chef 将这些插件从 github 下载并安装到我的 jenkins 实例的正确方法/语法是什么?

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.当这样的页面是 Jenkins 插件的官方来源时:plugins.jenkins.io/workflow-cps,屏幕右侧是一个“档案”链接,它将带您到所有 .hpi 列表给定插件的可用版本。 IE updates.jenkins.io/download/plugins/workflow-cps . IE updates.jenkins.io/download/plugins/workflow-cps 。 Using the link address for the listed versions you can source the appropriate .hpi file使用列出版本的链接地址,您可以获取适当的 .hpi 文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM