Skip to content

Instantly share code, notes, and snippets.

@rohitasva
Created March 25, 2016 14:53
Show Gist options
  • Save rohitasva/efaca281523dd1cc847e to your computer and use it in GitHub Desktop.
Save rohitasva/efaca281523dd1cc847e to your computer and use it in GitHub Desktop.
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
println "Queue contains ${queue.items.length} items"
queue.clear()
println "Queue cleared"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment