Jenkins continue pipeline on failed stage

守給你的承諾、 提交于 2019-11-30 22:55:50

If you use the parallel step, this should work as you expect by default, as the failFast option, which aborts the job if any of the parallel branches fail, defaults to false.

For example:

parallel(
    centos6: { build 'centos6.testing' },
    centos7: { build 'centos7.testing' },
    debian7: { build 'debian7-x64.testing' },
    debian8: { build 'debian8-x64.testing' }
)

If they should be run in a sequence you can do something like this:

def buildResult= 'success'
try{
  build 'centos6.testing'
}catch(e){
   buildResult = 'failure'
}
currentBuild.result = buildResult

If they should be run in parallell you just run them: https://www.cloudbees.com/blog/parallelism-and-distributed-builds-jenkins

What worked for me:

    'Task' : {
        build( job : "DemoJob-2", wait: false )
        build( job : "DemoJob-3", wait: false )
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!