Created
April 13, 2018 16:49
-
-
Save cterrykenzan/02dfb1104f47396bf2b2086d502b9098 to your computer and use it in GitHub Desktop.
jenkins dsl delete jobs with regex
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
// https://gist.github.com/nextrevision/d11b2df4e8b229c6855b | |
def matchedJobs = Jenkins.instance.items.findAll { job -> | |
job.name =~ /my_regex_here/ | |
} | |
matchedJobs.each { job -> | |
println job.name | |
//job.delete() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment