Created
July 26, 2019 15:27
-
-
Save phaneesh/c4987d9a5b9a88a88e9ae5655fb4cd46 to your computer and use it in GitHub Desktop.
Jenkins - Set Build History Retention
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 hudson.model.* | |
import hudson.maven.MavenModuleSet | |
import hudson.tasks.* | |
Hudson.instance.items.each { | |
if(it instanceof MavenModuleSet) { | |
if(it.getBuildDiscarder() != null && it.getBuildDiscarder() instanceof LogRotator) { | |
def l = new LogRotator(365,-1,-1,-1) | |
it.setBuildDIscarder(l) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment