简体   繁体   English

Jenkins 离线安装插件

[英]Jenkins install plugins offline

Installed Jenkins on a Linux server and want to install some plugins manually.在 Linux 服务器上安装了 Jenkins,想手动安装一些插件。

I want to install Blue Ocean and Artifactory.我想安装 Blue Ocean 和 Artifactory。

For both plugins I downloaded the hpi file and tried to install it, but I get a lot of dependency errors.对于这两个插件,我都下载了 hpi 文件并尝试安装它,但是我遇到了很多依赖项错误。

Do I now have to install those dependencies manually as well?我现在是否也必须手动安装这些依赖项? or is there a better way to do this?或者有更好的方法来做到这一点?

I tried to install one of those dependency and that one also had some dependency errors as well :-(我尝试安装这些依赖项之一,并且该依赖项也有一些依赖项错误:-(

The Linux server is not able to access the internet. Linux 服务器无法访问 Internet。

Thanks!谢谢!

Robert罗伯特

You are correct that BlueOcean has a lot of dependencies.您是对的,BlueOcean 有很多依赖项。

Given you are not able to connect to the internet you will need to download all 21 BlueOcean related hpi files and upload them from the Manage Jenkins > Manage Plugins > Advanced tab.鉴于您无法连接到互联网,您需要下载所有 21 个与 BlueOcean 相关的 hpi 文件,并从管理 Jenkins > 管理插件 > 高级选项卡上传它们。

Alternatively, if you have access to the server that your Jenkins instance is running on you can copy the hpi files into the %JENKINS_HOME%/plugins folder.或者,如果您有权访问运行 Jenkins 实例的服务器,则可以将 hpi 文件复制到 %JENKINS_HOME%/plugins 文件夹中。 The corresponding directories (exploded from the hpi, which is just a zip file) will be created on Jenkins restart.相应的目录(从 hpi 分解,它只是一个 zip 文件)将在 Jenkins 重启时创建。

The easiest way to acquire all 21 plugin files is to open The Jenkins plugin page and search for blueocean .获取所有 21 个插件文件的最简单方法是打开Jenkins 插件页面并搜索blueocean Download the same numbered version of all 21 and upload them one by one.下载所有21个相同编号的版本,并一一上传。 Order shouldn't be an issue.顺序应该不是问题。 As long as they are all present on restart the dependencies will resolve.只要它们在重启时都存在,依赖关系就会解决。

Same process goes for any other plugin.任何其他插件也有相同的过程。 If you're able to get the machine connected to the internet it will make the process a lot simpler as you will be able to use the update center, which manages dependencies and update notifications.如果您能够将机器连接到互联网,那么您将能够使用管理依赖项和更新通知的更新中心,从而使该过程变得更加简单。

Same case here.这里也是一样的情况。 Our Jenkins is setup in OpenShift which is not allowed to connect to the Internet.我们的 Jenkins 设置在 OpenShift 中,不允许连接到 Internet。 Downloading a plugin 1-by-1 is tiresome.逐一下载插件很烦人。 Not to mention that each plugins have its own dependencies that needs to be downloaded as well.更不用说每个插件都有自己需要下载的依赖项。

Here's what you would do...这就是你要做的...

  1. Run a Jenkins locally in a machine that can download plugins.在可以下载插件的机器上本地运行 Jenkins。
  2. Download and update all the plugins you want using the Update Center.使用更新中心下载并更新您想要的所有插件。
  3. Go %JENKINS_HOME%/plugins directory.转到%JENKINS_HOME%/plugins目录。 Inside this folder you would see *.jpi .在此文件夹中,您会看到*.jpi These are your plugins.这些是你的插件。 Its dependencies will be downloaded as well.它的依赖项也将被下载。
  4. Rename it to *.hpi then keep it in some directory.将其重命名为*.hpi然后将其保存在某个目录中。

To test...去测试...

  1. In your local Jenkins delete everything in %JENKINS_HOME%/plugins directory then put all *.hpi in this directory.在本地 Jenkins 中删除%JENKINS_HOME%/plugins目录中的所有*.hpi ,然后将所有*.hpi放入此目录中。
  2. Restart your local Jenkins.重新启动本地 Jenkins。
  3. Verify if the plugins you require are installed and updated.验证您需要的插件是否已安装和更新。

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

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