Class DiscardBuildPublisher

All Implemented Interfaces:
ExtensionPoint, Describable<Publisher>, BuildStep

public class DiscardBuildPublisher extends Recorder
Plugin that discards old build histories with greater user configurability than the core function. Enables discarding builds by status, keeping older builds for every N builds / N days, or discarding builds which have too small or too large logfile size (along with a combination of some of these).
Author:
tamagawahiroko, benjaminbeggs
  • Constructor Details

    • DiscardBuildPublisher

      @DataBoundConstructor public DiscardBuildPublisher(String daysToKeep, String intervalDaysToKeep, String numToKeep, String intervalNumToKeep, boolean discardSuccess, boolean discardUnstable, boolean discardFailure, boolean discardNotBuilt, boolean discardAborted, String minLogFileSize, String maxLogFileSize, String regexp, boolean keepLastBuilds, boolean holdMaxBuilds)
  • Method Details

    • perform

      public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener)
      Specified by:
      perform in interface BuildStep
      Overrides:
      perform in class BuildStepCompatibilityLayer
    • getDaysToKeep

      public String getDaysToKeep()
    • getNumToKeep

      public String getNumToKeep()
    • getMinLogFileSize

      public String getMinLogFileSize()
    • getMaxLogFileSize

      public String getMaxLogFileSize()
    • getIntervalDaysToKeep

      public String getIntervalDaysToKeep()
    • getRegexp

      public String getRegexp()
    • getIntervalNumToKeep

      public String getIntervalNumToKeep()
    • isDiscardSuccess

      public boolean isDiscardSuccess()
    • isDiscardUnstable

      public boolean isDiscardUnstable()
    • isDiscardFailure

      public boolean isDiscardFailure()
    • isDiscardNotBuilt

      public boolean isDiscardNotBuilt()
    • isDiscardAborted

      public boolean isDiscardAborted()
    • isKeepLastBuilds

      public boolean isKeepLastBuilds()
    • isHoldMaxBuilds

      public boolean isHoldMaxBuilds()
    • getDescriptor

      public DiscardBuildPublisher.DescriptorImpl getDescriptor()
      Specified by:
      getDescriptor in interface Describable<Publisher>
      Overrides:
      getDescriptor in class Recorder
    • getRequiredMonitorService

      public BuildStepMonitor getRequiredMonitorService()
    • getCurrentCalendar

      protected Calendar getCurrentCalendar()