Created
August 6, 2017 03:58
-
-
Save jmarcos-cano/e203c04ca2a4e4868c1df124e45328a9 to your computer and use it in GitHub Desktop.
Stop & Kill Jenkins stuck build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def jobname = "the-job-name" | |
def buildnum = 85 | |
def job = Jenkins.instance.getItemByFullName(jobname) | |
for (build in job.builds) { | |
if (buildnum == build.getNumber().toInteger()){ | |
if (build.isBuilding()){ | |
build.doStop(); | |
build.doKill(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great script helped me with my Developer collage that talks really fast.