我无法访问这两个服务器,因此 cli 不是一个选项,只有 jenkins ui 可用。我需要使用作业导入插件导入作业,但我无法弄清楚如何配置该插件以导入作业。有人可以帮我解决这个问题吗?
要配置 Jenkins 远程插件,您需要添加 Jenkins 服务器 来导入您的作业。
要添加 Jenkins 服务器,您需要转到 Jenkins 配置:
Manage Jenkins
> Configure System
> Job Import Plugin
或 http://jenkins-host:port/configure
并将 URL 和凭据添加到要从中导入作业的主机。
如果您没有凭据,则需要将它们添加到此服务器。为此,请单击 URL 设置下方的 Add 选项。
设置 Jenkins 服务器后,您将能够通过转到 Jenkins 主页上的
Job Import Plugin
选项或导航到 URL:http://jenkins-host:port/Job-import/
或较新版本中的 http://jenkins-host:port/job-import/
来使用 Jenkins 导入插件。
如果只添加一台Jenkins Server,则默认选中。否则,您需要选择正确的 Jenkins 服务器:
通常,您不需要设置远程文件夹或搜索文件夹选项,因此如果您使用默认的 Jenkins 设置,请将这些字段留空。
然后,单击查询!按钮开始导入。将显示包含所有可导入作业的页面。
您需要一一选择要导入的所有作业。如果您有很多工作(就像我的情况一样),这可能会有点乏味。最好同时选择“安装所需的插件”选项。
选择所有内容后,您可以单击
按钮最终开始导入。
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