jetbrains.buildServer.configs.kotlin.v2019_2 / Cleanup

Cleanup

class Cleanup

Specifies clean-up rules for project, build configuration, or template

Types

BaseRuleWrapper

inner class BaseRuleWrapper

Holds a base rule

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

<init>

Cleanup()

Specifies clean-up rules for project, build configuration, or template

Properties

keepRules

val keepRules: ArrayList<KeepRule>

preventDependencyCleanup

var preventDependencyCleanup: Boolean?

Specifies whether dependency builds should be cleaned. Null means use default, true means prevent clean-up, false means don't prevent clean-up.

Functions

all

fun all(days: Int? = null, builds: Int? = null): Unit

Adds an 'everything'-level clean-up rule. Either days or builds must be non-null. If they are both null, clean-up will not be configured.

artifacts

fun artifacts(days: Int? = null, builds: Int? = null, artifactPatterns: String? = null): Unit

Adds an artifacts-level clean-up rule. Either days or builds must be non-null. If they are both null, clean-up will not be configured.

baseRule

fun baseRule(init: BaseRuleWrapper.() -> Unit): Unit

Specifies a base rule. A base rule defines what data to clean up in general. Allows preserving a specified number of successful builds and/or choose the time period to keep builds in the history.

disableKeepRule

fun disableKeepRule(idToDisable: String): Unit

Disables an inherited keep rule by its ID

fun disableKeepRule(rule: KeepRule): Unit

Disables an inherited keep rule

findKeepRuleById

fun findKeepRuleById(id: String): KeepRule?

Finds a keep rule with the specified id

history

fun history(days: Int? = null, builds: Int? = null): Unit

Adds a history-level clean-up rule. Either days or builds must be non-null. If they are both null, clean-up will not be configured.

keepRule

fun keepRule(init: KeepRule.() -> Unit): KeepRule

Creates and registeres a new keep rule for this clean-up definition. IDs must be specified for all keep rules.

option

fun option(name: String, value: Boolean): Unit

Adds a specified clean-up option

validate

fun validate(consumer: ErrorConsumer): Unit

Extension Functions

copy

fun Cleanup.copy(): Cleanup

Copies the receiver cleanup

copyTo

fun Cleanup.copyTo(target: Cleanup): Cleanup

Copies the receiver cleanup to the specified target