且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 jenkins 中使用作业导入插件

更新时间:2021-09-25 02:24:15

要配置 Jenkins Remote Plugin,您需要添加一个 Jenkins Server 来导入您的作业.

To configure the Jenkins Remote Plugin, you need to add a Jenkins Server to import your jobs.

要添加 Jenkins 服务器,您需要继续进行 Jenkins 配置:Manage Jenkins >配置系统 >Job Import Pluginhttp://jenkins-host:port/configure 并将 Url 和凭据添加到将从中导入作业的主机.

To add a Jenkins Server, you need to go on your Jenkins configuration: Manage Jenkins > Configure System > Job Import Plugin or http://jenkins-host:port/configure and add the Url and credentials to the host from where will import the jobs.

如果您没有,则需要将凭据添加到此服务器,为此请单击 URL 设置下方的选项添加.

If you don't have, will need to add the credentials to this server, to do this click on the option Add bellow the Url settings.

设置 Jenkins 服务器后,您将能够通过转到 Jenkins 主页中的选项 Job Import Plugin 或转到 URL:http://来使用 Jenkins Import 插件jenkins-host:port/Job-import/http://jenkins-host:port/job-import/ 在新版本中.

After setting a Jenkins server, you will be able to use the Jenkins Import plugin by going to option Job Import Plugin in the Jenkins home or going to the URL: http://jenkins-host:port/Job-import/ or http://jenkins-host:port/job-import/ in the new versions.

如果你只添加了一个 Jenkins 服务器,它将被默认选择,否则,需要选择正确的 Jenkins 服务器:

If you added only a Jenkins Server it will be selected as default, otherwise, the correct Jenkins server will need to be selected:

通常您不需要设置远程文件夹搜索文件夹选项,因此如果您使用默认的 Jenkins 设置,请将这些字段留空.

Normally you don't need to set the Remote folder or Search into folders options, so if you use the default Jenkins settings, leave these fields blank.

然后,您将单击 Query! 按钮开始导入.将显示一个包含所有可导入作业的页面.

Then, you will click on the Query! button, to start your import. A page with all jobs available to be imported will be showed.

您需要逐一选择要导入的所有工作,如果您有很多工作(例如我的情况),这可能有点无聊.一个好主意是也选择 Install required plugins 选项.

You will need to select all the jobs you want to import one by one, if you have many jobs (like in my case) this can be a little boring. A good idea is to select the Install required plugins option too.

选择所有内容后,您可以点击导入!按钮最终开始导入.

After select everything, you can click on the Import! button to finally starts your import.