2015-12-28 25 views
4

我想使用参数化构建,它在配置本身中使用此参数。在同一构建配置中使用jenkins参数

definition of parameterized build

这么几步后,我想用参数来启动在参数VAR“詹金斯部署”

how to use the $param in this field?

詹金斯的工作有没有办法在詹金斯在这个范围内使用“jenkins-deployment”var?

回答

2

您可以使用Build Flow plugin来实现。

在我的示例中,我创建了一个作业A以触发另一个名为“在控制台日志上测试”的作业。

作业A参数:

enter image description here

作业A的构建流程步骤:

enter image description here

控制台输出:

enter image description here

另一个这样如所述here所述,使用Workflow plugin

+0

这是一个很好的“解决方法”,适用于自己的。不幸的是,它不适用于我现有的Jenkins系统,因为它阻止将一些从站连接到系统。所以它不适合我。 :( – rickroyce

+0

另一种选择是使用工作流插件,如下所述:https://github.com/jenkinsci/workflow-plugin/blob/master/TUTORIAL.md#using-slaves(我已更新我的答案) –

+0

是真的没有其他方法可以做到这一点吗?可以直接在项目配置中使用的某种变量替换 – dragosb