Skip to end of metadata
Go to start of metadata
You are viewing documentation of TeamCity 5.x, which is not the most recent released version of TeamCity. Please refer to the listing to choose another version.

Table of Contents

TeamCity can optionally add a label into the version control system for the sources used for a particular build. This is useful if you need to collect all of the sources for a specific build in order to recreate it. You can choose to apply the VCS label for all builds or only for successful ones.

To label a finished build manually:

  1. Open Changes tab of the build results page.
  2. Click Label this build sources link.
  3. In a dialog that appears, type the desired label name and select VCS roots to apply the label to.

The labeling process takes place after the build finish and doesn't affect the build status. If the label fails it will not change the build's status.

VCS labeling is supported for ClearCase, CVS, Perforce, StarTeam and Subversion.

  • Make sure the credentials you specify allow write access to the sources repository.
  • "Moving" labels (label with the same name for different builds e.g. "SNAPSHOT") are currently supported only for CVS.
  • Note that if you change VCS settings of a build configuration they will be used for labeling only in the new builds. Manual "Label this build sources" action available form build's Changes tab uses the settings actual for the build.


Subversion VCS roots need additional configuration for VCS labeling to work. The labeling rules need to be specified to define the SVN repository structure.

Labeling rules are specified as newline-delimited rules each of uses the following format:

The repository paths can be relative and absolute (starting from "/"). Absolute paths are resolved from the SVN repository root (the topmost directory you have in your repository), relative paths are resolved from the TeamCity VCS root.

When creating a label, the sources residing under TrunkOrBranchRepositoryPath will be put into the tagDirectoryRepositoryPath/tagName directory, where tagName is the name of the label as defined by the labeling pattern of the build configuration.
If no sources match the TrunkOrBranchRepositoryPath, then no label will be created.
The path tagDirectoryRepositoryPath should already exist in the repository.
If tagDirectoryRepositoryPath directory already contains subdirectory with the current label name, the labeling process will fail, and the old tag directory won't be deleted or affected.

For example, there is a VCS root with the URL svn://address/root/project where svn://address/root is the repository root, and the repository has the structure:

In this case the labeling rules should be:

VCS Labeling Failure Notifications

TeamCity starts the VCS labeling process, when the build is finished. Thus VCS Labeling does not affect the build status, and therefore is not a standard notification event. However, TeamCity allows notifying about labeling failure.
If the labeling process failed due to some reason, TeamCity sends notification to all users, that have subscribed for notification about failed builds of the current build configuration.

See Also: