Failure / Unstable via Script Return Code

后端 未结 6 1923
别那么骄傲
别那么骄傲 2020-12-11 04:04

I would like to get the result of my jenkins build job either failed (red), unstable (yellow) or successfull (green)...

If i return non zero from my shell script i c

6条回答
  •  不思量自难忘°
    2020-12-11 04:29

    Simple way in a pipeline:

    try {
        sh ""
    } catch (Exception e) {
        // Caught a non-zero exit code
        // Mark build as unstable.
        currentBuild.result='UNSTABLE'
    }
    

提交回复
热议问题