Created
April 30, 2020 08:10
-
-
Save madchap/1ccbb544619d78f877c18afdaf40b1e7 to your computer and use it in GitHub Desktop.
Cancel all Jenkins queued builds
This file contains 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 hudson.model.* | |
import jenkins.model.Jenkins | |
def q = Jenkins.instance.queue | |
q.items.findAll { it.task.name.startsWith('your_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