[英]In pipeline job how to build freestyle downstream jobs with their choice parameters?
Here i am building multiple freestyle jobs with their choice parameters from one pipeline job.在这里,我正在使用他们从一个管道作业中选择的参数构建多个自由式作业。 In my all downstream freestyle job I am using common choice parameters with the values在我的所有下游自由泳工作中,我使用带有值的常见选择参数
Name: Branch
Choice: trunk
branch/2.3
branch/2.4
in my Pipeline also i declared the same parameters in choices在我的管道中,我也在选择中声明了相同的参数
Name: Branch
Choice: trunk
branch/2.3
branch/2.4
Here is the pipeline code i am using这是我正在使用的管道代码
pipeline
{
node any
stage ('JOBS'){
build job: 'testjob1', propagate: false
build job: 'testjob2', propagate: false
build job: 'testjob3', propagate: false
build job: 'testjob4', propagate: false
build job: 'testjob5', propagate: false
}
}
But for me it s building downstream jobs but its taking the default first choice.但对我来说,它正在建立下游工作,但它是默认的首选。
The choice parameter always picks up the first choice as default unless you select a different parameter.除非您 select 使用不同的参数,否则选择参数始终选择第一个选项作为默认值。 Since, your freestyle jobs are triggered by an upstream pipeline, you need to explicitly pass your choice for every freestyle job as:由于您的自由式作业是由上游管道触发的,因此您需要为每个自由式作业明确传递您的选择:
build job: 'testjob1', parameters: [[$class: 'StringParameterValue', name: 'Branch', value: Branch]], propagate: false
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.