-
-
Save epishan/0ab7a2459a06f2092635c5f2b7a8a8ac to your computer and use it in GitHub Desktop.
[jenlins] Jenkins jobs cleanup
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
// Groovy script to disable job in Hudson | |
import hudson.model.*; | |
def JOB_PATTERN = ~/^GO.*.deploy*.staging2$/; //find all jobs starting with "MY_JOB". | |
(Hudson.instance.items.findAll { job -> job.name =~ JOB_PATTERN }).each { job_to_update -> | |
if (job_to_update.name =~ "^\$") { | |
return; | |
} | |
else { | |
println ("Updating job " + job_to_update.name); | |
job_to_update.disable() | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment