Skip to content

Instantly share code, notes, and snippets.

@udyvish
Created January 17, 2018 00:32
Show Gist options
  • Save udyvish/c333719d59fa2ca23beeae440f010cc8 to your computer and use it in GitHub Desktop.
Save udyvish/c333719d59fa2ca23beeae440f010cc8 to your computer and use it in GitHub Desktop.
the below script kills all the jobs which are stuck
Jenkins.instance.getItems().each { job ->
job.builds.each { build ->
if (build.getResult().equals(null)) {
build.finish(hudson.model.Result.ABORTED, new java.io.IOException("Aborting build"));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment