Skip to content

Instantly share code, notes, and snippets.

@christ66
Last active April 3, 2017 21:26
Show Gist options
  • Save christ66/5f39a0a0a7f899a270a54c18af00c358 to your computer and use it in GitHub Desktop.
Save christ66/5f39a0a0a7f899a270a54c18af00c358 to your computer and use it in GitHub Desktop.
Discard old builds for all projects - Jenkins
def daysToKeep = 0
def numToKeep = 0
def artifactDaysToKeep = 0
def artifactNumToKeep = 0
Jenkins.instance.getAllItems(AbstractProject.class).each{ it ->
it.setBuildDiscarder(new LogRotator(daysToKeep, numToKeep, artifactDaysToKeep, artifactNumToKeep))
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment