Schedule Trigger
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()
}
Content copied to clipboard }
}
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()
}
Content copied to clipboard }
}
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"
}
}
Content copied to clipboard }
}
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")
}
}
Content copied to clipboard }
}
See also
Types
Properties
Branch filter specifies set of branches where build should be triggered
Parameters that are added to triggered builds
Whether the trigger should allow builds optimization in the build queue. By default optimization is enabled.
Whether the build should be triggered with clean checkout
When the enforceCleanCheckout is set to true specifies whether the clean checkout should also be applied to all dependencies.
Specifies whether build should be triggered only when the specified watched build changes. Use always, or onWatchedBuildChange methods to specify it.
When this option is enabled the build will be triggered on all enabled compatible agents
Specifies trigger rules
Whether the trigger should run build only when there are pending changes in the build configuration
Functions
Don't watch any build, trigger build using the specified schedule
Configures build parameters that are applied to triggered builds
Deletes all configured build parameters
Copies parameters of this object to the specified target
Build is triggered by time in the cron expression
Build is triggered daily on the specified hour and minuted in the given timezone
Trigger build only when the watched build changes
Validates this object and reports found errors to the provided consumer
Build is triggered weekly on the specified day on the specified hour and minuted in the given timezone