Created
November 18, 2015 09:33
-
-
Save michbeck100/dd2c33e3a4023f05357c to your computer and use it in GitHub Desktop.
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.maven.MavenModuleSet | |
hudson.model.Hudson.instance.items.findAll { | |
job -> | |
!job.isBuilding() && job.isBuildable() && job instanceof MavenModuleSet | |
}.each { | |
job -> | |
def builds = job.builds.collect {it.getDisplayName()} | |
println("deleting modules for builds other than " + builds) | |
job.getModules().each { | |
module -> | |
println("module name = " + module.name) | |
module.builds.each { | |
build -> | |
if (!builds.contains(build.getDisplayName())) { | |
println("deleting build " + build.getDisplayName()) | |
build.delete() | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment