我怎样才能在詹金斯添加管理构建? [英] How can i add an administrative build in jenkins?

查看:141
本文介绍了我怎样才能在詹金斯添加管理构建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出如何我可以添加一个管理构建詹金斯将管理的几个版本,以及我怎样才能从路径管理构建的参数给孩子建立。

i'm trying to figure out how can i add an administrative build to Jenkins that will manage a few builds, and how can i path the parameters from the administrative build to the child builds.

推荐答案

参数触发插件就是你在寻找什么。

Parameterized Trigger Plugin is what you're looking for.

一旦你安装了这个插件,请参考下面第二个快照。转到配置项目的页面。搜索构建和GT;添加构建步骤>从下拉菜单中选择触发/呼叫建立在其他项目。之后,点击添加参数>从下拉菜单中,选择当前构建参数

Once you've installed the plugin, refer 2nd snapshot below. Go to Configure page of your project. Search for Build > Add build step > From drop-down menu, select Trigger/call builds on other projects. After that, click on Add Parameters > From drop-down menu, select Current build parameters

以上快照就是我定义一个字符串参数,将在其子作业B可以利用父作业A的。

Above snapshot is of parent job A where i am defining a string parameter, which will be utilized in its child job B.

以上快照又是我在哪里指定下游(子)作业B,也使当前构建参数这将确保父作业A的父作业的定义的参数子作业的可见。一旦我们使用这些设置完成后,我们应该能够看到孩子作业B上行链路工作如下图所示。这将确认一切都很好,至今。 :)

Above snapshot is again of parent job A where i am specifying the downstream (child) job B and also enabling Current build parameters, which will ensure that the parameters defined in parent job A are visible to child jobs. Once we are done with these settings, we should be able to see the upstream job link in the child job B as shown below. This will confirm that things are fine till now. :)

现在的唯一任务左边是使用/调用子作业B.变量(父作业的定义),这显示在下面的快照:

Now the only task left is using/calling the variable (defined in parent job A) in child job B. This is shown in the below snapshot:


  • 我测试了它在Windows所以我用%字符串%

如果你是UNIX / Linux计算机上,选择执行shell,并使用 $ {字符串}

If you're on UNIX/Linux machine, select 'Execute shell' and use ${string}

这篇关于我怎样才能在詹金斯添加管理构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆