我有一套有很多管道的詹金斯装置。我写了一条新的管道,可以同时启动所有管道。我想建立其他阶段,即使其中一个失败。
当前的脚本如下所示
stage 'CentOS6'
build 'centos6.testing'
stage 'CentOS7'
build 'centos7.testing'
stage 'Debian7'
build 'debian7-x64.testing'
stage 'Debian8'
build 'debian8-x64.testing'构建脚本本身包含它们应该运行的节点。
即使其中一个阶段失败,脚本如何继续进行以下阶段。
干杯
发布于 2016-12-08 16:11:07
如果您使用parallel步骤,默认情况下,这应该可以正常工作,因为failFast选项默认为false,如果任何并行分支失败,该选项将中止作业。
例如:
parallel(
centos6: { build 'centos6.testing' },
centos7: { build 'centos7.testing' },
debian7: { build 'debian7-x64.testing' },
debian8: { build 'debian8-x64.testing' }
)发布于 2016-12-08 13:28:14
如果它们应该按顺序运行,您可以这样做:
def buildResult= 'success'
try{
build 'centos6.testing'
}catch(e){
buildResult = 'failure'
}
currentBuild.result = buildResult如果它们应该并行运行,您只需运行它们:https://www.cloudbees.com/blog/parallelism-and-distributed-builds-jenkins
发布于 2017-05-18 09:42:01
对我有用的是:
'Task' : {
build( job : "DemoJob-2", wait: false )
build( job : "DemoJob-3", wait: false )
}https://stackoverflow.com/questions/41038079
复制相似问题