Continue Jenkins pipeline past failed stage

前端 未结 8 1224
北荒
北荒 2020-12-13 12:23

I have a series of stages that perform quick checks. I want to perform them all, even if there are failures. For example:

stage(\'one\') {
    node {
              


        
8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-13 12:41

    This should work. However all boxes are red if even only one fails, but you can see boxes with error marked, so you will easily distinguish failed jobs.

    def indexes = ['one', 'two', 'three']
    
    node() {
        for (index in indexes) {
            catchError {
                stage(index) {
                    println index
                    sh '''echo "123"'''
                }
            }
        }
    }
    

提交回复
热议问题