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()
}
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
Constructors
Types
Specifies which build to watch
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
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.
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
Properties
Branch filter specifies set of branches where build should be triggered
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.