Predefined Properties

Search
Searching TeamCity 4.x Documentation
Table of Contents

The predefined properties can originate from several scopes:

  • Server Build Properties - the properties provided by TeamCity on the server-side in the scope of a particular build. An example of such property is a build number
  • Agent Properties - properties provided by an agent. The properties are not specific to any build and characterize agent environment. e.g. path to .Net framework.
  • Agent Build Properties - properties provided on the agent side in the scope of a particular build. These properties are passed into a build. e.g. path to a file with a list of changed files.

Server Build Properties

System Property Name Environment Variable Name Description
teamcity.version TEAMCITY_VERSION Version of TeamCity server. This property can be used to determine the build is run within TeamCity.
teamcity.projectName TEAMCITY_PROJECT_NAME Name of the project the current build belongs to.
teamcity.buildConfName TEAMCITY_BUILDCONF_NAME Name of the Build Configuration the current build belongs to.
build.is.personal BUILD_IS_PERSONAL Is set to true if the build is a personal one. Is not defined otherwise.
build.number BUILD_NUMBER Build number assigned to the build by TeamCity using the build number format. The property is assigned based on the build number format.
build.vcs.number.<simplified VCS root name> BUILD_VCS_NUMBER_<simplified VCS root name> Latest VCS revision included in the build for the root identified. Here <simplified VCS root name> is the VCS root name with all non-alphanumeric characters replaced with _ symbol. Please ensure your VCS roots names differ sufficiently and are not mapped into the same simplified name (in this case the value of the property can get any). If there is only a single root in the configuration, build.vcs.number property (without the root name) is also provided.
Please note that this value is a VCS-specific (e.g. for SVN the value is a revision number while for CVS it is a timestamp)

In previous versions of TeamCity we used different format for VCS build number: {build.vcs.number.N} where N is VCS root order number in the build configuration. If you still need this to work you can launch TeamCity with special JVM option:

-Dteamcity.buildVcsNumberCompatibilityMode=true

For a complete list of supported properties please refer to the Properties and environment variables section of Build Configuration settings in TeamCity Web UI.

Agent Properties

Agent-specific properties are defined on each build agent and vary depending on its environment. Aside from standard properties (for example os.name or os.arch, etc. — these are provided by JVM running on agent) agents also have properties based on installed applications. TeamCity automatically detects a number of applications including the presence of .NET Framework, Visual Studio and adds the corresponding system properties and environment variables. A complete list of predefined agent-specific properties is provided in the table below.

If additional applications/libraries are available in the environment, the administrator can manually define the property in the <agent home>/conf/buildAgent.properties file. These properties can be used for setting various build configuration options, for defining build configuration requirements (e.g. existence or lack of some property) and inside build scripts. For more information on how to reference these properties see Using Properties page.

The actual properties defined on agent can be reviewed on the Agent Details page.

Predefined Property Description
agent.name Name of the agent as specified in the buildAgent.properties agent configuration file. Can be used to set a requirement of build configuration to run (or not run) on particular build agent.
agent.work.dir Path of Agent Working Directory.
agent.home.dir Path of Agent Home Directory.
os.name corresponding JVM property
os.arch corresponding JVM property
os.version corresponding JVM property
user.country corresponding JVM property
user.home corresponding JVM property
user.timezone corresponding JVM property
user.name corresponding JVM property
user.language corresponding JVM property
user.variant corresponding JVM property
file.encoding corresponding JVM property
file.separator corresponding JVM property
path.separator corresponding JVM property
DotNetFramework<version>[_x86|_x64]
This property is defined if the corresponding version(s) of .NET Framework is installed
DotNetFramework<version>[_x86|_x64]_Path This property's value is set to the corresponding framework version(s) path(s)
DotNetFrameworkSDK<version>[_x86|_x64]
This property is defined if the corresponding version(s) of .NET Framework SDK is installed
DotNetFrameworkSDK<version>[_x86|_x64]_Path
This property's value is the path of the corresponding framework SDK version
WindowsSDK<version>
This property is defined if the corresponding version of Windows SDK is installed. Version can be either 6.0 or 6.0A
VS[2003|2005|2008] This property is defined if the corresponding version(s) of Visual Studio is installed
VS[2003|2005|2008]_Path This property's value is the path to the directory that contains devenv.exe
teamcity.dotnet.nunitlauncher<version> This property's value is the path to the directory that contains the standalone NUnit test launcher, NUnitLauncher.exe. The version number refers to the version of .NET Framework under which the test will run. The version equals the version of .NET Framework and can have a value of 1.1, 2.0, or 2.0vsts.
teamcity.dotnet.nunitlauncher.msbuild.task The property's value is the path to the directory that contains the MSBuild task dll providing the NUnit task for MSBuild, sln2005, or sln2008.
  • Make sure to replace "." with "_" when using properties in MSBuild scripts. That is use teamcity_dotnet_nunitlauncher_msbuild_task instead of teamcity.dotnet.nunitlauncher.msbuild.task
  • _x86 and _x64 property suffixes are used to designate the specific version of the framework.
  • teamcity.dotnet.nunitlauncher properties can not be hidden or disabled.

You can disable the automatic detection of the predefined properties by editing the buildAgent.properties file and adding the disableDotNetDetection property.

Please note that disableDotNetDetection property is case-sensitive.

This property can have the following values:

Value Description
empty string All versions of .NET Framework will be detected and added to the Agent Properties
'*' All existing versions of .NET Framework will not be detected and thus not included in the Agent Properties
version number(s) (Values should be separated by commas) Excludes versions of .NET Framework starting with that number
'windowsSDK6.0' or 'w' Excludes Windows SDK 6.0
VS<X> Excludes Visual Studio version <X>, where <X> can be 2003, 2005, 2008 or left blank to exclude all existing versions of Visual Studio
Examples Description
disableDotNetDetection=3 Excludes .NET Framework 3.0, 3.5 and all other versions starting with 3
disableDotNetDetection=1.1,2.0 Excludes .NET Framework versions 1.1 and 2.0
disableDotNetDetection=w,2.0,VS2003 Excludes Windows SDK 6.0, .NET Framework 2.0 and Visual Studio 2003
You can refer to the Agent Details page of the TeamCity web UI to view properties set for a particular Build Agent.

Agent Build Properties

These properties are unique for each build: they are calculated on the agent right before the build start and are then passed into the build.

Property Name Environment Variable Name Description
teamcity.build.checkoutDir none Checkout directory used for the build.
teamcity.build.workingDir none Working directory where the build is started.
teamcity.build.tempDir none Full path of the build temp directory automatically generated by TeamCity. The directory will be cleaned after the build.
teamcity.auth.userId none Generated username that can be used to download artifacts of other build configurations. Valid only during the build.
teamcity.auth.password none Generated password that can be used to download artifacts of other build configurations. Valid only during the build.
teamcity.build.properties.file TEAMCITY_BUILD_PROPERTIES_FILE Full name (including path) of the file containing all the system.* properties passed to the build. "system." prefix stripped off. The file uses Java properties file format (e.g. special symbols are backslash-escaped).
teamcity.build.changedFiles.file none Full path to a file with information about changed files included in the build. This property is useful if you want to [support running of new and modified tests in your tests runner]. You can use this file to determine whether any tests were modified and run them before others. The file contains lines separated by new line. Each line corresponds to one file and has the following format:
<relative file path>:<change type>:<revision>

where:

  • <relative file path> is a path to a file relative to the current checkout directory.
  • <change type> is a type of modification and can have the following values: CHANGED, ADDED, REMOVED, NOT_CHANGED, DIRECTORY_CHANGED, DIRECTORY_ADDED, DIRECTORY_REMOVED
  • <revision> is a file revision in repository. If file is a part of change list started via remote run then string <personal> will be written instead of file revision.




See Also:

Labels