Created
December 24, 2024 04:51
-
-
Save phaneesh/b33efdc8d19c0454d57698b11e184877 to your computer and use it in GitHub Desktop.
jenkins-delete-jobs.groovy
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.* | |
String[] toBeDeletedJobs = [] | |
def matchedJobs = Jenkins.instance.items.findAll { job -> | |
toBeDeletedJobs.contains(job.name) | |
} | |
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