我想创建一个父管道作业,其中包含调用触发其他作业的阶段,这些作业也是管道作业。
我可以实现吗?
这是我想要的骨架: 父作业的脚本:
pipeline {
parallel{
stage("A") {
build 'name of job 1 which is a pipeline job again and has a parallel block with stages in it'
}
stage("B") {
build 'name of job 2 which is a pipeline job again and has a parallel block with stages in it'
}
stage("C") {
build 'name of job 3 which is a pipeline job again and has a parallel block with stages in it'
}
}
}
这样做有用吗?有没有办法实现这个
答案 0 :(得分:3)
当然可以, 这就是我们正在使用的,我们通过从当前执行中开始相同的工作来促进环境之间的推进,并且不要等待结果。
build(job: "org/${jobName}/${BRANCH_NAME}",
parameters: [
new StringParameterValue('ENV', env),
new StringParameterValue('ENV_NO', env_no),
new StringParameterValue('ARTIFACT_NAME', params.ARTIFACT_NAME)
],
propagate: false,
wait: false,
)
有关所有选项,请参阅参考 https://jenkins.io/doc/pipeline/steps/pipeline-build-step/