詹金斯在失败的舞台上继续管道

rad*_*rad 4 jenkins jenkins-pipeline

我有一堆jenkins设置与一堆管道.我写了一个新的管道,可以立即启动所有管道.我想建立其他阶段,即使其中一个失败.

该脚本目前看起来像这样

stage 'CentOS6'
build 'centos6.testing'

stage 'CentOS7'
build 'centos7.testing'

stage 'Debian7'
build 'debian7-x64.testing'

stage 'Debian8'
build 'debian8-x64.testing'
Run Code Online (Sandbox Code Playgroud)

构建脚本本身包含它们应运行的节点.

即使其中一个失败,脚本如何继续执行以下阶段.

干杯

MaT*_*ePe 5

如果它们应该按顺序运行,您可以执行以下操作:

def buildResult= 'success'
try{
  build 'centos6.testing'
}catch(e){
   buildResult = 'failure'
}
currentBuild.result = buildResult
Run Code Online (Sandbox Code Playgroud)

如果他们应该并行运行你只需运行它们:https: //www.cloudbees.com/blog/parallelism-and-distributed-builds-jenkins