Abort current build from pipeline in Jenkins

后端 未结 7 1378
时光说笑
时光说笑 2020-12-02 13:06

I have a Jenkins pipeline which has multiple stages, for example:

node(\"nodename\") {
  stage(\"Checkout\") {
    git ....
  }
  stage(\"Check Preconditions         


        
7条回答
  •  猫巷女王i
    2020-12-02 13:26

    You can go to the script console of Jenkins and run the following to abort a hung / any Jenkins job build/run:

    Jenkins .instance.getItemByFullName("JobName")
            .getBuildByNumber(JobNumber)
            .finish(hudson.model.Result.ABORTED, new java.io.IOException("Aborting build"));
    

提交回复
热议问题