你如何安装 Jenkins 工作流多分支插件

How do you install Jenkins workflow multibranch plugin

我刚刚在 EC2 中设置了一个 vanilla Jenkins (ver. 1.634) 实例并按照 tutorial 安装了工作流插件。一切都按预期工作。

现在我想继续尝试这个插件的多分支部分。我注意到教程说:

A new Workflow: Multibranch plugin (as of this writing still in beta) offers a better way of versioning your Workflow and managing your project. You need to create a distinct project type, Multibranch Workflow.

第一次尝试

我的意思是 http://updates.jenkins-ci.org/update-center.json 不存在此插件,而是其他一些更新中心。所以经过一些搜索,我最终找到了 this Jenkins page 并将更新中心更改为 http://updates.jenkins-ci.org/experimental/update-center.json 在查看了一组新的可用插件之后, Workflow: Multibranch 插件仍然缺席。

第二次尝试

然后我开始尝试自己打包插件,方法是从多分支目录中克隆 jenkinsci/workflow-plugin repo 和 运行 mvn package,这给了我一直以来使用的 workflow-multibranch.hpi 插件试图通过更新站点查找。接下来,我尝试手动安装插件 Jenkins -> PluginManager -> Advanced (Tab) -> Upload Plugin.

Jenkins 向我显示了以下错误:

java.io.IOException: Failed to dynamically deploy this plugin
  at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1328)
  at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1126)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
  at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
  at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Failed to install workflow-multibranch plugin
  at hudson.PluginManager.dynamicLoad(PluginManager.java:487)
  at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1324)
  ... 5 more
Caused by: java.io.IOException: Dependency workflow-job (1.11-beta-1), branch-api (0.2-beta-5), workflow-cps (1.11-beta-1) doesn't exist
  at hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:533)
  at hudson.PluginManager.dynamicLoad(PluginManager.java:477)
  ... 6 more

现在,在我最终通过手动安装堆栈跟踪中列出的所有这些依赖插件来弄乱我的插件之前,有没有更直接的方法来安装 Workflow:Multibranch 插件?

谢谢。

我最终一次安装一个插件,直到我发现一个相当奇怪的依赖项,Cloudbees。在查看了 Cloudbees 的 Jenkins 插件列表后,我发现了使 Workflow: Multibranch 出现在可用插件列表中所需的插件。

CloudBees Free Enterprise Plugins This plugin installs free enterprise plugins from CloudBees. The following plugins are automatically installed: Folders: easily organize your jobs Backup to Cloud: backup your Jenkins into CloudBees cloud Wasted Minutes: find out if you are short of slaves and need to add capacity to speed up builds CloudBees Status: find out how much of the free CloudBees Jenkins capacity in the cloud is available for your use Note: You will be asked to register for a free CloudBees account to use these plugins (This plugin was formerly known as the CloudBees Plugin Gateway plugin)

安装此插件并重新启动 Jenkins 后,我就可以安装 Workflow: Multibranch。此外,所有其他 Workflow:* 插件都有可用的更新。

希望这可以节省我花费的时间。

您设置实验更新中心是正确的,但是

After looking at the new set of available plugins, the Workflow: Multibranch plugin was still absent.

可能只是意味着您需要单击 高级 选项卡中的 立即更新 按钮以实际获取新的更新中心内容。