TeamCity 4.0 Help

VCS Labeling

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.

SubversionLabelingRulesSubversion

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

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

TrunkOrBranchRepositoryPath => tagDirectoryRepositoryPath

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 2.Version Control Settings 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:

-project --trunk --branch1 --branch2 --tags

In this case the labeling rules should be:

/project/trunk=>/project/tags /project/branch1=>/project/tags /project/branch2=>/project/tags

VCS Labeling Failure Notifications

TeamCity starts the VCSLabelingSupport process, when the build is finished. Thus VCS Labeling does not affect the build status, and therefore is not a standard Notification Conditions. 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 Conditions of the current build configuration.

Last modified: 20 April 2023