[英]Jenkins parameterized build - Parameters that are functions of other parameters
I am trying to define these default values for parameters in my Jenkins parameterized build: 我正在尝试在我的Jenkins参数化构建中为参数定义这些默认值:
p1 = x
p2 = ${p1}y // should evaluate to "xy"
The problem is that when I build, p2
gets set to ${p1}y
instead of xy
. 问题是当我构建时, p2
设置为${p1}y
而不是xy
。
Rather than using a string parameter, You can add Pre-Built steps, in that do Execute Shell. 您可以在执行Shell的过程中添加预构建步骤,而不是使用字符串参数。 Enter the below. 输入以下内容。
echo p2=${p1}y
So p2 will be accessible in the project. 因此,在项目中可以访问p2。 When you want to use the same, use ${p2} 如果要使用相同的名称,请使用$ {p2}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.