简体   繁体   English

如何为jenkins参数化的远程触发器插件设置远程主机

[英]how to setup remote host for jenkins parameterized remote trigger plugin

How do you setup the remote host field for Jenkins Parameterized Remote Trigger Plugin? 您如何设置Jenkins参数化远程触发器插件的远程主机字段? The documentation doesn't seem clear to me, and this explanatory blog post has some Jenkins UI features that I can't locate. 该文档对我来说似乎并不清晰, 这篇说明性博客文章具有一些我无法找到的Jenkins UI功能。

This article suggests going to Manage Jenkins > Configure Credentials to add a Domain, but when I go there I see no "Add Domain" button: 本文建议转到“ 管理Jenkins”>“配置凭据”以添加域,但是当我去那里时,看不到“添加域”按钮:

在此处输入图片说明

The plugin wiki shows screenshots of a section on a page labelled "Parameterized Remote Trigger Configuration". 插件Wiki在标有“ Parameterized Remote Trigger Configuration”的页面上显示该部分的屏幕截图。 How do I view this section in Jenkins, where is it? 我如何在詹金斯中查看本节,它在哪里? I thought it might be in Manage Jenkins > Manage Plugins , but there is no "Manage" or "Configure" button there: 我以为它可能在“ 管理Jenkins”>“管理插件”中 ,但是那里没有“管理”或“配置”按钮:

在此处输入图片说明

How do I add a "Host" to my Parameterized Remote Trigger Plugin so that I can use it in a Jenkins job? 如何在我的参数化远程触发器插件中添加“主机”,以便可以在Jenkins作业中使用它?

在此处输入图片说明

Update : The official Parameterized Remote Plugin has gone stale and may not fully work. 更新 :官方的参数化远程插件已过时,可能无法完全使用。 sap-production appears to be maintaining a much more up-to-date version here . SAP生产似乎保持一个更先进的最新版本在这里 You can install it on your instance by cloning the repo then running mvn package . 您可以通过克隆存储库然后运行mvn package来在实例上安装它。 Then install the ./target/Parameterized-Remote-Trigger.hpi file using Manage Jenkins > Manage Plugins > Advanced (tab) > Upload Plugin 然后使用Manage Jenkins> Manage Plugins> Advanced(tab)> Upload Plugin安装./target/Parameterized-Remote-Trigger.hpi文件

It appears that the Jenkins UI has changed over time. Jenkins用户界面似乎已经随着时间而改变。 Here is how it works now. 现在是这样工作的。

Add The Domain 添加域

On the left sidebar of the main Jenkins UI, click Credentials > System > Add domain 在Jenkins主UI的左侧栏中,单击凭证>系统>添加域

在此处输入图片说明

Name the domain whatever you like, then click Add > Hostname 随意命名域名,然后单击添加>主机名

在此处输入图片说明

Fill in the IP or hostname of the remote Jenkins instance in "Includes" 在“包含”中填写远程Jenkins实例的IP或主机名

在此处输入图片说明

Set Up Credentials 设置凭证

The previous step leaves you on a page with an "Add Credentials" button. 上一步使您进入带有“添加凭据”按钮的页面。 Click that. 点击那个。 If you can't find it, then you can locate it from the main view via: Credentials > System > Your Domain 如果找不到它,则可以通过以下方式从主视图中找到它:凭证>系统> 您的域

在此处输入图片说明

If not already selected, then select "Username with password". 如果尚未选择,则选择“带密码的用户名”。 Choose a scope. 选择一个范围。

Fill in all the fields as shown. 如图所示,填写所有字段。 I personally recommend creating a new user on the remote Jenkins and generating an API token and using that here, but you could also just generate an API token for your own user. 我个人建议在远程Jenkins上创建一个新用户并生成一个API令牌并在此处使用它,但是您也可以只为自己的用户生成一个API令牌。 Click OK. 单击确定。

在此处输入图片说明

Configure Parameterized Remote Trigger Plugin 配置参数化的远程触发器插件

From the main Jenkins page click Manage Jenkins > Configure System , then scroll down to the Parameterized Remote Trigger Configuration section and click Add . 在Jenkins主页上,单击Manage Jenkins>配置系统 ,然后向下滚动到Parameterized Remote Trigger Configuration部分,然后单击Add

Fill out at least the Authentication and Remote address and port properties, then click Save. 至少填写“ 身份验证”和“ 远程地址和端口”属性,然后单击“保存”。

在此处输入图片说明

Add Build Step In Job 在作业中添加构建步骤

Open an existing Jenkins job or create a new one, scroll down to the Build section, and add the build step Trigger a remote parameterized job : 打开一个现有的Jenkins作业或创建一个新的作业,向下滚动到Build部分,然后添加构建步骤触发远程参数化作业

在此处输入图片说明

Select your host, and fill the rest of the values in. 选择您的主机,然后填写其余的值。

在此处输入图片说明

This is well documented on the plugin's wiki page . 插件的Wiki页面上对此进行了详细记录。 See the "System configuration option" section. 请参阅“系统配置选项”部分。 If you're having trouble with one of the fields specifically, please add more detail to your question. 如果您在其中一个字段上遇到问题,请在问题中添加更多详细信息。

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

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