Skip to content

Instantly share code, notes, and snippets.

@raghur
Created June 16, 2014 08:35
Show Gist options
  • Save raghur/dd6b1317d5d58cb7a9ab to your computer and use it in GitHub Desktop.
Save raghur/dd6b1317d5d58cb7a9ab to your computer and use it in GitHub Desktop.
Delete build logs from Jenkins from the script console
import jenkins.model.*;
import hudson.model.Fingerprint.RangeSet;
def jobName = "Monitors/Monitor-Wadlogs (DevTest)"
def buildRange = "123-2140"
def j = Jenkins.instance.getItemByFullName(jobName);
println j
def r = RangeSet.fromString(buildRange, true);
j.getBuilds(r).each { it.delete() }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment