ScheduleTrigger

Base class for Schedule Build Triggers. Schedule trigger runs builds by specified schedule.

Example. Trigger a build every day at 10AM even if there are no pending changes.

buildType {
// Other Build Type settings ...
triggers {
// Other Triggers ...
        schedule {
schedulingPolicy = daily {
hour = 10
}
withPendingChangesOnly = false
triggerBuild = always()
}





}
}




Example. Check for pending changes twice per hour in branches with name starting with 'feature/' and trigger builds there if pending changes found.

/*
buildType {
// Other Build Type settings ...
triggers {
// Other Triggers ...
        schedule {
schedulingPolicy = cron {
minutes = "*/30"
}

branchFilter = "+:feature/*"
withPendingChangesOnly = true
triggerBuild = always()
}







}
}




*/

Example. Trigger a build every day at 10AM but only if there is a freshly finished build in a build configuration with id "MyApp". See also build changes.

buildType {
// Other Build Type settings ...
triggers {
// Other Triggers ...
        schedule {
schedulingPolicy = daily {
hour = 10
}

withPendingChangesOnly = false
triggerBuild = onWatchedBuildChange {
buildType = "MyApp"
}
}








}
}




Example. Trigger a build at 10AM every day with an additional parameter "release" set to "true". See also triggered build customization.

buildType {
// Other Build Type settings ...
triggers {
// Other Triggers ...
        schedule {
schedulingPolicy = daily {
hour = 10
}
triggerBuild = always()
withPendingChangesOnly = false

buildParams {
param("release", "true")
}
}









}
}




See also

Constructors

Link copied to clipboard
constructor(init: ScheduleTrigger.() -> Unit)
constructor()

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Specifies which build to watch

Properties

Link copied to clipboard
var branchFilter: <Error class: unknown class>

Branch filter specifies set of branches where build should be triggered

Link copied to clipboard

Parameters that are added to triggered builds

Link copied to clipboard

Specifies whether the trigger is enabled

Link copied to clipboard
var enableQueueOptimization: <Error class: unknown class>

Whether the trigger should allow builds optimization in the build queue. By default optimization is enabled.

Link copied to clipboard

Whether the build should be triggered with clean checkout

Link copied to clipboard

When the enforceCleanCheckout is set to true specifies whether the clean checkout should also be applied to all dependencies.

Link copied to clipboard
var id: String?

Trigger id, if not set will be generated

Link copied to clipboard
Link copied to clipboard
var schedulingPolicy: <Error class: unknown class>

Specifies when the build should be triggered. Use daily, weekly, or cron methods to specify it.

Link copied to clipboard
var triggerBuild: <Error class: unknown class>

Specifies whether build should be triggered only when the specified watched build changes. Use always, or onWatchedBuildChange methods to specify it.

Link copied to clipboard
var triggerBuildOnAllCompatibleAgents: <Error class: unknown class>

When this option is enabled the build will be triggered on all enabled compatible agents

Link copied to clipboard
var triggerRules: <Error class: unknown class>

Specifies trigger rules

Link copied to clipboard

Trigger type

Link copied to clipboard
var withPendingChangesOnly: <Error class: unknown class>

Whether the trigger should run build only when there are pending changes in the build configuration

Functions

Link copied to clipboard

Don't watch any build, trigger build using the specified schedule

Link copied to clipboard
fun booleanParameter(customName: String? = null, trueValue: String? = "true", falseValue: String? = "false"): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard

Configures build parameters that are applied to triggered builds

Link copied to clipboard
fun clear()
Link copied to clipboard

Deletes all configured build parameters

Link copied to clipboard
fun <T : CompoundParam<T>> compoundParameter(customName: String? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
fun <T : Parametrized> copyParamsTo(target: T): T

Copies parameters of this object to the specified target

Link copied to clipboard
open fun create(): Trigger

Creates an instance of this trigger via reflection using a no argument constructor, used during copying. Throws an error if this class doesn't have a default constructor. Subclasses can override it to create an instance without using a default constructor.

Link copied to clipboard
Link copied to clipboard

Build is triggered daily on the specified hour and minuted in the given timezone

Link copied to clipboard
fun doubleParameter(customName: String? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
fun <E : Enum<E>> enumParameter(customName: String? = null, mapping: Map<E, String?>? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
fun findRawParam(paramName: String): Parameter?
Link copied to clipboard
fun hasParam(paramName: String): Boolean
Link copied to clipboard
fun intParameter(customName: String? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
Link copied to clipboard
fun param(name: String, value: String)

Adds parameter with specified name and value

Link copied to clipboard
fun removeRawParam(paramName: String)
Link copied to clipboard
open fun stringParameter(customName: String? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
open override fun toString(): String
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

Build is triggered weekly on the specified day on the specified hour and minuted in the given timezone