Created
November 1, 2018 15:42
-
-
Save AaronDMarasco-VSI/6dff0eabac9b4fec31b60dc443eec2bc to your computer and use it in GitHub Desktop.
Stop running Jenkins jobs (not queued)
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
// Not sure if this worked or timed out... | |
def buildingJobs = Jenkins.instance.getAllItems(Job.class).findAll { it.isBuilding() } | |
buildingJobs.each { job-> | |
if (job.name =~ /build_assets/) { | |
println(job.name) | |
job._getRuns()[-1].doStop() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment