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

问题描述 投票:0回答:3

我无法访问这两个服务器,因此 cli 不是一个选项,只有 jenkins ui 可用。我需要使用作业导入插件导入作业,但我无法弄清楚如何配置该插件以导入作业。有人可以帮我解决这个问题吗?

amazon-web-services jenkins amazon-ec2 jenkins-pipeline jenkins-plugins
3个回答
24
投票

要配置 Jenkins 远程插件,您需要添加 Jenkins 服务器 来导入您的作业。

设置 Jenkins 服务器

要添加 Jenkins 服务器,您需要转到 Jenkins 配置:

Manage Jenkins
>
Configure System
>
Job Import Plugin
http://jenkins-host:port/configure
并将 URL 和凭据添加到要从中导入作业的主机。

Jenkins Server Configuration

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

Adding Credentials

使用 Jenkins 导入插件

设置 Jenkins 服务器后,您将能够通过转到 Jenkins 主页上的

Job Import Plugin
选项或导航到 URL:
http://jenkins-host:port/Job-import/
或较新版本中的
http://jenkins-host:port/job-import/
来使用 Jenkins 导入插件。

如果只添加一台Jenkins Server,则默认选中。否则,您需要选择正确的 Jenkins 服务器:

Selecting Jenkins Server

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

然后,单击查询!按钮开始导入。将显示包含所有可导入作业的页面。

您需要一一选择要导入的所有作业。如果您有很多工作(就像我的情况一样),这可能会有点乏味。最好同时选择“安装所需的插件”选项。

Selecting Jobs to Import选择所有内容后,您可以单击

导入!

按钮最终开始导入。


0
投票

    您需要在需要的服务器上安装作业导入插件 将作业导入到。
  1. 然后转到jenkins左侧显示的插件。
  2. 输入 url 并进行身份验证,远程服务器的作业将列出。
  3. 选择要复制并完成的作业。 Jenkins 会将作业复制到您的服务器。
参考此链接


0
投票

Failed to list job from remote http://{remoteIP}:8080/. Response status code received 401. Content: <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/> <title>Error 401 Unauthorized</title> </head> <body><h2>HTTP ERROR 401 Unauthorized</h2> <table> <tr><th>URI:</th><td>/api/xml</td></tr> <tr><th>STATUS:</th><td>401</td></tr> <tr><th>MESSAGE:</th><td>Unauthorized</td></tr> <tr><th>SERVLET:</th><td>Stapler</td></tr> </table> <hr/><a href="https://eclipse.org/jetty">Powered by Jetty:// 9.4.45.v20220203</a><hr/> </body> </html>

如果想知道在哪里检查日志,那就是 
http://<your_jenkins_ip/domain>:8080/logs/all

    

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.