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

Configuring Build Triggers

Last modified: 20 April 2023

Configuring VCS Build Triggers Rules



VCS Build Triggers automatically start a new build each time TeamCity detects that updates have been checked into the Version Control System. By default, when this option is enabled, TeamCity scans all of the build configuration's VCS roots. TeamCity offers a wide range of wildcards and operators to exclude parts of the VCS roots or check ins performed by specific users from a VCS trigger. These rules should be entered in Build trigger rules text box.

The general syntax for a single rule is as follows:

+|-:[user=VCS_username;][root=VCS_path]:[Ant-like wildcard]

Please refer to Ant documentation for the description of Ant-like wildcards

When entering rules please note the following:

  • To enter multiple rules, each rule should be entered on a single line separated by a line feed character.

  • The most specific rules are applied first, regardless of the order that the rules are listed in.

  • As soon as you enter a "+" operator, TeamCity will remove the default include all setting. To manually reset it, enter "+:**".

  • If you don't enter an operator it will default to "+".

An example with three build triggering rules:

-:/src/help -:**.html -:user=techwriter;root=Internal SVN:/doc/*.xml -:lib/**

In the above example,

  • the rule "-:/src/help" excludes a build being triggered when updated files are checked into the src/help path of the VCS root.

  • the rule "-:**.html" excludes all .html files from trigger a build.

  • the rule "-:user=techwriter;root=Internal SVN:/doc/*.xml" excludes builds being triggered by .xml files checked in by user "techwriter" to the doc path of the VCS root named Internal SVN (as defined in the VCS Settings).

  • the rule "-:lib/**" prevents the build from triggering by updates to the "lib" directory of the agent. All files placed into the directory (by processing VCS root checkout rules) will not cause a build to be triggered.