TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

Configuring Schedule Triggers

Last modified: 20 April 2023

The Schedule Trigger allows you to set the time when a build of the configuration will be run. The Builds Schedule page of the current project settings displays the configured build times.

This section describes the triggering conditions used by the Schedule Trigger.

Date and Time



Besides triggering builds daily or weekly at a specified time for a particular time zone, you can specify advanced time settings using cron-like expressions. This format provides more flexible scheduling options.

TeamCity uses Quartz for working with cron expressions. See the examples below or consider using the CronMaker utility to generate expressions based on Quartz cron format.

Examples



See also other examples.

Brief description of the cron format used



Cron expressions are comprised of six fields and one optional field separated with a white space. The fields are respectively described as follows:

For the description of the special characters, please refer to Quartz CronTrigger Tutorial.

VCS Settings



You can restrict schedule trigger to start builds only if there are pending changes in your version control by selecting the corresponding option. The Trigger only if there are pending changes option considers newly detected pending changes only: if there were pending changes before the trigger was created, the build is not triggered.

The branch filter in the Schedule Trigger works as follows:

  • if the option trigger build only if there are pending changes is turned ON, then the trigger will add a build to the queue for all branches matched by the trigger branch filter where pending changes exist

  • if trigger build only if there are pending changes is turned OFF, then the trigger will add a build to the queue for all branches matched by the trigger branch filter regardless of presence of pending changes there

Build Changes



Since TeamCity 9.1, the Schedule Trigger has the ability to watch builds in other build configurations and trigger a build if these builds change.

In the Build Changes section, select the corresponding box and specify the build configuration and the type of build to watch: last successful build, last pinned build, last finished build, or the last finished build with a specified tag.

TeamCity can promote a build if there is a dependency (snapshot or artifact) on its build configuration.