Triggers

Collection of build triggers in build configuration or template.

See also triggers().

Example. VCS trigger which triggers builds only in the default branch

See also Vcs Trigger

triggers {
vcs {
branchFilter = "+:<default>"
}
}

Example. Schedule trigger executing once per day at 9AM

See also Schedule Trigger

triggers {
schedule {
schedulingPolicy = daily {
hour = 9
}
triggerBuild = always()
withPendingChangesOnly = false
}
}

Example. Retry build

Retries a failed build with the same settings and the same revisions. See also Retry build trigger

triggers {
retryBuild {
attempts = 2
retryWithTheSameRevisions = true

enforceCleanCheckout = true
enforceCleanCheckoutForDependencies = true
buildParams {
param("param1", "value1")
param("param2", "%build.number%")
}
}
}

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard

Adds a Branch Remote Run Trigger which triggers a new personal build each time TeamCity detects changes in particular branches

Link copied to clipboard

Copies the receiver triggers

Link copied to clipboard

Copies the receiver triggers to the specified target

Link copied to clipboard

Adds Finish Build Trigger to build configuration or template

Link copied to clipboard

Adds a trigger. running builds when there is a modification of the maven dependency content.

Link copied to clipboard

Adds a trigger running builds when there is a modification of the snapshot dependency content in the remote repository.

Link copied to clipboard
Link copied to clipboard

Adds Retry Build Trigger

Link copied to clipboard

Adds Schedule Build Trigger to build configuration or template

Link copied to clipboard
fun trigger(trigger: Trigger)

Adds the specified trigger

fun trigger(init: Trigger.() -> Unit): Trigger

Adds a trigger initialized with the specified init block

Link copied to clipboard
open override fun validate(consumer: ErrorConsumer)

Validates this object and reports found errors to the provided consumer

Link copied to clipboard

Adds VCS trigger to the build configuration or template