The predefined properties can originate from several scopes:
There is also a special kind of server-side build properties that can be used in references while defining other properties, but are not passed into the build. See Reference-only Server Properties below for the listing of such 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 |
||
|
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> |
Latest VCS revision included in the build for the root identified. See below for the <simplified VCS root name> description. If there is only a single root in the configuration,
In versions of TeamCity prior to 4.0, different format for VCS revision number when specified in build number pattern was used: {
|
<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).
These properties are available only since TeamCity 4.5. In TeamCity 4.0.x you could only use #Dependencies Properties in build number and VCS labeling pattern. |
These are the properties that other properties can reference (only if defined on Build Parameters page), but that are not passed to the build themselves.
You can get the full set of reference-only server properties by adding system.teamcity.debug.dump.parameters
property to the build configuration and examining "Available reference-only server properties" section in the build log.
The following sets of such properties exist:
Properties provided by the builds the current build depends on (via snapshot or artifact dependency).
Dependencies properties have the following format:
dep.<btID>.<property name> |
<btID
— is the internal ID of the build configuration to get the property from. Only the configurations the current one has snapshot or artifact dependencies on are supported. Indirect dependencies configurations are also available (e.g. A depends on B and B depends on C - A will have C's properties available).<property name>
— the name of the server build property of the build configuration with the given ID.These are the settings of a VCS roots attached to the build configuration.
VCS properties have the following format:
vcsroot.<simplified VCS root name>.<VCS root property name> |
<simplified VCS root name>
— is the VCS root name as described above.<VCS root property name>
— the name of the VCS root property. This is VCS-specific and depends on the VCS support. You can get the available list of properties as described above.If there is only one VCS root in a build configuration, <simplified VCS root name>.
part can be omitted.
Properties marked by VCS support as secure
(for example, passwords) are not available as reference 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 (for example, existence or lack of some property) and inside build scripts. For more information on how to reference these properties see Defining and Using Build Parameters in Build Configuration 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 |
agent.work.dir |
Path of Agent Work Directory. |
agent.home.dir |
Path of Agent Home Directory. |
os.name |
corresponding JVM property (see JDK help for properties description) |
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. (Supported versions are 1.1, 2.0, 3.5, 4.0) |
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. (Supported versions are 1.1, 2.0) |
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. (Supported versions are 6.0, 6.0A, 7.0, 7.0A, 7.1) |
VS[2003|2005|2008|2010] |
This property is defined if the corresponding version(s) of Visual Studio is installed |
VS[2003|2005|2008|2010]_Path |
This property's value is the path to the directory that contains |
teamcity.dotnet.nunitlauncher<version> |
This property value is the path to the directory that contains the standalone NUnit test launcher, |
teamcity.dotnet.nunitlauncher.msbuild.task |
The property value is the path to the directory that contains the MSBuild task dll providing the NUnit task for MSBuild, Visual Studio (sln). |
|
This is not supported You can disable the automatic detection of the predefined properties by editing the {{buildAgent.properties}} file and adding the *disableDotNetDetection* property. {note}Please note that {{disableDotNetDetection}} property is case-sensitive.{note} 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 | {tip}You can refer to the *Agent Details* page of the TeamCity web UI to view properties set for a particular Build Agent. {tip} |
System Property Name |
Environment Variable Name |
Description |
---|---|---|
teamcity.build.checkoutDir |
none |
Checkout directory used for the build. This property is unique for each build: it is calculated on the agent right before build start and is then passed to the build. |
teamcity.build.workingDir |
none |
Working directory where the build is started. This is a path where TeamCity build runner is supposed to start a process. This is a runner-specific property, thus it is re-resolved on agent for each step. |
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 |
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. This file is only available if there were changes in the build. |