Jenkins continue pipeline on failed stage

后端 未结 3 1125
盖世英雄少女心
盖世英雄少女心 2021-01-06 05:10

I have a jenkins setup with a bunch of pipelines. I wrote a new pipeline which can start all pipelines at once. I would like to build other stages, even if one of them fails

相关标签:
3条回答
  • 2021-01-06 05:40

    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

    0 讨论(0)
  • 2021-01-06 05:47

    What worked for me:

        'Task' : {
            build( job : "DemoJob-2", wait: false )
            build( job : "DemoJob-3", wait: false )
        }
    
    0 讨论(0)
  • 2021-01-06 06:00

    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' }
    )
    
    0 讨论(0)
提交回复
热议问题