KeepRule

class KeepRule

Specifies a keep rule. A keep rule defines what particular data to preserve during the clean-up. Multiple keep rules can be assigned to a project or build configuration.

Constructors

Link copied to clipboard
fun KeepRule()

Types

Link copied to clipboard
interface DataToKeep

Represents dataToKeep

Link copied to clipboard
class DaysLimit

Configures KeepAtLeast which keeps builds based on their age

Link copied to clipboard
class HistoryAndStatistics : Cleanup.KeepRule.DataToKeep

Holds configuration of history and statistics dataToKeep

Link copied to clipboard
class KeepAtLeast

Holds the range limit for this keep rule

Link copied to clipboard
class KeepRuleFilters

Holds all the filters used to pick out the builds this keep rule will preserve

Link copied to clipboard
class PreserveArtifacts(val patterns: String)

Holds the artifacts pattern to keep

Functions

Link copied to clipboard
fun all(): Cleanup.KeepRule.PreserveArtifacts

Specifies that all artifacts should be kept in this HistoryAndStatistics

Link copied to clipboard
fun allArtifacts(): Cleanup.KeepRule.HistoryAndStatistics

Specifies that only artifacts should be kept in builds preserved by this keep rule. History and statistics will be automatically preserved, logs will be removed (if no other keep rule specifies keeping them).

Link copied to clipboard
fun allBuilds(): <ERROR CLASS>

Specifies that this keep rule will preserve all builds matched by the selected filters

Link copied to clipboard
fun applyPerEachBranch()

If used, then keepAtLeast will be applied to each branch selected by the branch filter (or to each branch in the configuration if no branch filter is specified) separately.

Link copied to clipboard
fun applyToBuilds(init: Cleanup.KeepRule.KeepRuleFilters.() -> Unit)

Allows specifying filters to pick out the builds this keep rule will preserve

Link copied to clipboard
fun artifacts(vararg patterns: String): Cleanup.KeepRule.HistoryAndStatistics

Specifies that only artifacts matched by patterns should be kept in builds preserved by this keep rule. History and statistics will be automatically preserved, logs will be removed (if no other keep rule specifies keeping them).

Link copied to clipboard
fun buildDataToKeep(body: Parametrized.() -> Unit): Cleanup.KeepRule.DataToKeep

Builds dataToKeep from parameters

Link copied to clipboard
fun buildKeepAtLeast(body: Parametrized.() -> Unit): Cleanup.KeepRule.KeepAtLeast

Constructs the keepAtLeast from raw parameters

Link copied to clipboard
fun builds(n: Int): <ERROR CLASS>

Specifies that this keep rule will preserve all builds matched by the selected filters up to the nth build

Link copied to clipboard
fun byPattern(vararg patterns: String): Cleanup.KeepRule.PreserveArtifacts

Specifies that all artifacts matched by patterns should be kept in this HistoryAndStatistics

Link copied to clipboard
fun days(n: Int): <ERROR CLASS>

Specifies that this keep rule will preserve all builds matched by the selected filters up to the nth day since the current day

fun days(n: Int, init: Cleanup.KeepRule.DaysLimit.() -> Unit): Cleanup.KeepRule.KeepAtLeast

Specifies that this keep rule will preserve all builds matched by the selected filters up to the nth day. Allows specifying the policy to select the limiting day in the DaysLimit.since field.

Link copied to clipboard
fun everything(): Cleanup.KeepRule.DataToKeep

Specifies that everything should be kept in builds preserved by this keep rule

Link copied to clipboard

Specifies that only history and statistics should be kept in builds preserved by this keep rule. Logs and artifacts will be removed (if no other keep rule specifies keeping them).

Specifies that history and statistics should be kept in builds preserved by this keep rule and allows to select which parts of build results (e.g. logs, artifacts) should also be kept.

Link copied to clipboard
fun logs(): Cleanup.KeepRule.HistoryAndStatistics

Specifies that only logs should be kept in builds preserved by this keep rule. History and statistics will be automatically preserved, artifacts will be removed (if no other keep rule specifies keeping them).

Link copied to clipboard
fun param(name: String, value: String?)
Link copied to clipboard
fun statisticsOnly(): Cleanup.KeepRule.DataToKeep

Specifies that only statistics should be kept in builds preserved by this keep rule. Builds won't be visible in the build history, logs and artifacts will be removed (if no other keep rule specifies keeping them).

Properties

Link copied to clipboard
var applyPerEachBranch: Boolean = false

If set to true then the keepAtLeast will be applied to each branch selected by the branch filter (or to each branch in the configuration if no branch filter is specified) separately. applyPerEachBranch could be used to enable.

Link copied to clipboard
var dataToKeep: Cleanup.KeepRule.DataToKeep? = null

Specifies what data should be kept in builds preserved by this keep rule

Link copied to clipboard
var disabled: Boolean = false

Disables this rule

Link copied to clipboard
var id: String? = null

ID of this keep rule. Every keep rule must have an ID unique to the current project/build configuration. Any sequence of letters, digits and '_' signs is allowed. It's recommended to use human-readable IDs expressing the origin of the rule: e.g. 'keepAllReleases' or 'keepHistory'.

Link copied to clipboard
var keepAtLeast: Cleanup.KeepRule.KeepAtLeast? = null

Defines the limit for this keep rule. allBuilds will be used if not specified

Link copied to clipboard
var preserveArtifactsDependencies: Boolean = false

If set to true and if this build configuration uses any artifact dependencies, then this keep rule will prevent deleting builds in build configurations where the artifact dependencies are used from.