如何强制kill jenkins jobs progress

对于一些僵尸build,无法通过手动点击kill build,该如何处理?

"Manage Jenkins" > "Script Console"

第一种:

def build = Jenkins.instance.getItemByFullName("xxxxx").getBuildByNumber(26522)

build.doStop()

build.doKill()

第二种:强制杀除线程

Thread.getAllStackTraces().keySet().each() {

    if (it.name.contains('xxxxx')) { 

      println "Stopping $it.name"

      it.stop()

    }

}

How to stop an unstoppable zombie job on Jenkins without restarting the server? - Stack Overflow

你可能感兴趣的:(jenkins,jenkins)