Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

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 (for example, 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 (for example, path to a file with a list of changed files).

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 true if the build is a personal one. Is not defined otherwise.

Anchor
buildNumber
buildNumber
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.

teamcity.build.id

none

Internal unique id used by TeamCity to reference builds.

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.

Anchor
build_vcs_number
build_vcs_number
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. See below for the <simplified VCS root name> description. If there is only a single root in the configuration, build.vcs.number property (without the root name) is also provided.

Note

Please note that this value is a VCS-specific (for example, for SVN the value is a revision number while for CVS it is a timestamp)


In versions of TeamCity prior to 4.0, different format for VCS revision number when specified in build number pattern was used: {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 internal option:

Code Block
teamcity.buildVcsNumberCompatibilityMode=true

...

Reference-only Server Properties

Wiki Markup
{show-if
:mode
=edit
}
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.
{show-if}

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.

...

The following sets of such properties exist:

Dependencies Properties

Properties provided by the builds the current build depends on (via snapshot or artifact dependency).

...

  • <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.

...

  • <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.

...

Where <simplified VCS root name> is the VCS root name as described above.

When TeamCity starts a build in configuration where Branch specification is configured it adds branch label to each build. This branch label is also available as configuration parameter:

...

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.

...

Note
  • 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.

Wiki Markup
{hidden-data

...

}
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}

{hidden-data}

Agent Build Properties

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

...