Created
October 8, 2015 20:42
-
-
Save mshuler/1610e4091458b31612b2 to your computer and use it in GitHub Desktop.
Clear Jenkins queue of all jobs starting with 'job_name_' (use { it.task.name }.each for clearing the entire queue)
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
import jenkins.model.* | |
def q = Jenkins.instance.queue | |
q.items.findAll { it.task.name.startsWith('job_name_') }.each { q.cancel(it.task) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment