How to mark a build unstable in Jenkins when running shell scripts

后端 未结 14 2183
情歌与酒
情歌与酒 2020-11-27 11:31

In a project I\'m working on, we are using shell scripts to execute different tasks. Some are sh/bash scripts that run rsync, and some are PHP scripts. One of the PHP script

14条回答
  •  悲哀的现实
    2020-11-27 11:56

    You should use Jenkinsfile to wrap your build script and simply mark the current build as UNSTABLE by using currentBuild.result = "UNSTABLE".

       stage {
          status = /* your build command goes here */
          if (status === "MARK-AS-UNSTABLE") {
            currentBuild.result = "UNSTABLE"
          }
       }
    

提交回复
热议问题