Skip to content

Instantly share code, notes, and snippets.

View dylanfoster's full-sized avatar
🏠
🌮

Dylan Foster dylanfoster

🏠
🌮
View GitHub Profile
@tomcbe
tomcbe / disable-jenkins-jobs.groovy
Created February 1, 2018 14:03
Disable all Jenkins jobs on an instance and clear the build queue
// Disable all the Jenkins jobs
import hudson.model.*
for(item in Hudson.instance.items) {
println("Disabled job: " + item.name + '\n')
item.disabled=true
item.save()
}
def queue = Hudson.instance.queue