Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save einyx/91ee31a785afcd73969b8c65ed92da5c to your computer and use it in GitHub Desktop.
Save einyx/91ee31a785afcd73969b8c65ed92da5c to your computer and use it in GitHub Desktop.
Kill all queued jenkins jobs
import hudson.model.*
def q = Jenkins.instance.queue
q.items.each {
if (it =~ /deploy-to/) {
q.cancel(it.task)
}
}
import hudson.model.*
def q = Jenkins.instance.queue
q.items.each { q.cancel(it.task) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment