List of Predefined Build Parameters
TeamCity provides a dozens of predefined build parameters ready to be used in the settings of a build configuration or in build scripts.
All these parameters (except Predefined Configuration Parameters) are passed to a build process. Note that the techniques required to access these parameters may vary depending on your build type (for example, see the Build Properties section for the information on accessing TeamCity system properties in Gradle builds).
Predefined Server Build Parameters
These parameters are generated on the server side in the scope of a particular build — for example, a build number.
Server build parameters are typically available as a system property and a corresponding environment variable.
system.teamcity.version | env.TEAMCITY_VERSION
The version of the TeamCity server. This property can be used to determine if the build runs within TeamCity.
system.teamcity.projectName | env.TEAMCITY_PROJECT_NAME
The name of the project the current build belongs to.
system.teamcity.buildConfName | env.TEAMCITY_BUILDCONF_NAME
The name of the build configuration the current build belongs to.
The unique ID used by TeamCity to reference the build configuration the current build belongs to.
The full name (including the path) of the file that contains all the build parameters in alphabetical order. This file is written when a build process starts and uses the Java Properties File format (for example, special characters are backslash-escaped). See also: build.properties.file
system.build.is.personal | env.BUILD_IS_PERSONAL
truefor personal builds. Undefined (does not exist) for regular builds.
system.build.number | env.BUILD_NUMBER
The build number assigned to the build by TeamCity. The parameter uses the special build number format.
The link to the current build.
The internal unique ID used by TeamCity to reference builds.
system.build.vcs.number.<VCS_root_ID> | env.BUILD_VCS_NUMBER_<VCS_root_ID>
The latest VCS revision included in the build for the specified root. See the following article for more information about VCS root IDs: Configuring VCS Roots.
If a build configuration has only one VCS root, you can use the
build.vcs.numberparameter without the root ID identifier.
This value is a VCS-specific. For example, a revision number for SVN and a timestamp for CVS.
Predefined Agent Build Parameters
These system properties are unique for each build (for example, a path to a file that contains a list of changes). Their values are calculated on the agent side right before the build starts and then passed to the build.
The checkout directory used for the build.
The working directory where the build is started. This is the path where a TeamCity build runner is supposed to start a process. This is a runner-specific property, thus it has a different value for each step.
A full path of the build temp directory generated by TeamCity. The directory is cleaned after the build.
A full path to the file with information about changed files included in the build. You can use this property to support risk test reordering in your custom runner for tests.
This file is not available for history builds and if there were no changes in this particular build.
system.teamcity.build.properties.file | env.TEAMCITY_BUILD_PROPERTIES_FILE
The full name (including the path) of the file containing all build system properties without their
system.postfix. This file is written when a build process starts and uses the Java Properties File format (for example, special characters are backslash-escaped).
Predefined Agent Environment Parameters
These agent-specific parameters are defined on each build agent and vary depending on its environment. Aside from standard parameters (for example,
teamcity.agent.jvm.os.arch provided by the JVM running on an agent), agents can have parameters based on their installed software. TeamCity automatically detects software like .NET Framework, Mono, or Visual Studio and adds the corresponding system properties and environment variables.
If an agent machine has additional software installed, system administrators can modify the
<Agent Home>/conf/buildAgent.properties file to override values of corresponding parameters.
To check all existing parameters and their current values for a given build agent, open the agent details page and switch to the Parameters tab. See this link for more information: Checking Parameter Values.
The name of the agent as specified in the
buildAgent.propertiesagent configuration file. You can use agent names to specify agent requirements and limit the number of agents a target configuration can use.
The path to the agent work directory.
Free space available in the agent work directory.
The path to the agent home directory
The path to the Tools directory on the agent.
The operating system version. Reports a value of the corresponding JVM property.
The user country. Reports a value of the corresponding JVM property.
The user's home directory. Reports a value of the corresponding JVM property.
The user's timezone. Reports a value of the corresponding JVM property.
The user's account name. Reports a value of the corresponding JVM property.
The user's primary OS language. Reports a value of the corresponding JVM property.
An arbitrary value used to indicate a variation of a user locale. Reports a value of the corresponding JVM property.
The name of the default charset, defaults to UTF-8. Reports a value of the corresponding JVM property.
The file separator. Reports a value of the corresponding JVM property.
The path separator. Reports a value of the corresponding JVM property.
Java Runtime Environment specification version. Return the value of the java.specification.version JVM property.
Java Virtual Machine implementation version. Reports a value of the corresponding JVM property.
Java installation directory. See the following section for more information: Java-Related Environment Variables.
The agent's OS bitness.
The .NET CLI version.
The path to .NET CLI executable.
Defined only if the corresponding version(s) of .NET Framework runtime is installed.
This parameter's value is set to the corresponding framework runtime version(s) path(s).
Note that this parameter is defined only for the latest installed version per major release. For example, if you installed versions 3.5, 4.5, and 4.8, this parameter will only be defined for 3.5 and 4.8. Version/Parameter 4.5 will be omitted since a newer version of .NET Framework 4 is present. To explicitly define such a version, consider using the
Defined if the corresponding version(s) of .NET Framework SDK is installed.
The path to the corresponding framework SDK version.
The path to the corresponding Reference assemblies (AKA Targeting Pack) location.
The .NET SDK version.
Lists all .NET workloads installed on the agent machine.
<version>suffix is the version of an installed .NET SDK. For instance, if version 7.0.300 is installed, the agent will report the `DotNetWorkloads_7.0.300` parameter.
In addition to these full SDK versions, agents report workload parameters with shortened
major.minorsuffixes. For example, if an agent machine has 7.0.100, 7.0.200, and 7.0.300 .NET SDKs installed, the
DotNetWorkloads_7.0parameter that refers to the highest 7.0.300 version will be reported.
The parameter value is a string of comma-separated workload names, according to folders in the <dotnet_dir>/metadata/workloads/<sdk_version>/InstalledWorkloads directory. For instance, "android,maui-ios,wasm-tools".
Defined only if the corresponding version of Windows SDK is installed.
The path of the corresponding version of Windows SDK.
Defined if the corresponding version(s) of Visual Studio is installed
The path to the Visual Studio installation folder (the directory that contains devenv.exe).
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.
The path to the directory that contains the MSBuild task
dllproviding the NUnit task for MSBuild, Visual Studio (sln).
The path to the directory that contains MSBuild 2.0 listener and tasks assemblies.
The path to the directory that contains MSBuild 4.0 listener and tasks assemblies.
The agent port used by the TeamCity server to connect to the agent.
The protocol used for data transfers between the agent and the server.
The CPU benchmarking result for the agent.
The number of cores/threads on the agent machine's CPU.
The name of the build agent host.
Java-Related Environment Variables
When a build agent starts, it detects the installed JDK and JRE and then defines Java-related environment variables as described below. If a started agent already has the Java-related environment variables set, they are not redefined.
These variables can be used in build scripts as usual environment variables.
Detecting Java on Agent
An agent searches and launches all Java installations to verify they are valid. It determines the Java version and bitness based on the output.
The following locations are searched (some locations are common for all OSs, some are OS-specific):
A custom directory on the agent, if defined. See how to define a custom directory.
The agent tools directory,
<Agent Home Directory>/tools, is checked for containing a JRE or JDK. By default, the subdirectories of
/toolsare not scanned. To search the subdirectories, define
For Unix and macOS, remember to set the executable bit on the files for TeamCity to be able to launch the discovered Java.
In the paths specified by the
JRE_HOMEenvironment variables, if defined.
The OS-specific locations:
The Windows Registry is searched for the Java installed with the Java installer.
C:\Program Files (x86)directories are searched for
In the path specified by the
PATHenvironment variable, if defined.
Defining Custom Directory to Search for Java
You can define a custom directory on an agent to search for Java installations. To do this, add the
teamcity.agent.java.search.path property to the
You can define a list of directories: the type of separator character depends on the OS.
Defining Java-Related Environment Variables
For each version of Java, the following variable is defined:
JDK_<major>_<minor>[_x64]. For example,
env.JDK_1_6 (Java 6) or
env.JDK_14_0_x64 (Java 14 64-bit).
JDK variables are defined when the JDK is found. Before Java 11, the
JRE variables are defined when the JRE is found but the JDK is not.
_x64 variables point to 64-bit Java only. The variables without the
_x64 suffix may point to both 32-bit or 64-bit installations but 32-bit ones are preferred.
If several installations with the same major version and the same bitness, but different minor version/update are found, the latest one is selected.
In addition, the following variables are defined:
JAVA_HOME— for the latest JDK installation (but 32-bit one is preferred).
JDK_HOME— the same as
JRE_HOME— for the latest JRE or JDK installation (but 32-bit one is preferred), defined even if JDK is found.
JDK_HOME variables may point to different installations. For example, if JRE 1.7 and JDK 1.6 but no JDK 1.7 installed —
JRE_HOME will point to JRE 1.7 and
JDK_HOME will point to JDK 1.6.
All variables point to the Java Home directories, not to binary files. For example, if you want to execute javac version 1.6, you can use the following path:
Predefined Configuration Parameters
Configuration parameters can be referenced by other parameters (only if defined on the Parameters page), but they are not passed to the build.
To view the complete list of these server parameters, open the Parameters tab of any build or download the internal teamcity/properties/build.start.properties.gz artifact.
See the following article to learn more about dependency parameters: Use Parameters in Build Chains.
These are the settings of VCS roots attached to a build configuration.
VCS parameters have the following format:
<VCS_root_ID>— the VCS root ID.
<VCS_root_parameter_name>— the name of the VCS root parameter. This parameter is VCS-specific. See how to get the available list of parameters.
If there is only one VCS root in a build configuration, the
<VCS_root_ID>. part can be omitted.
Parameters marked by the VCS as
secure (for example, passwords) are not available for referencing.
Build Branch Parameters
When TeamCity starts a build in a build configuration where a branch specification is configured, it adds a branch label, or logical name, to each build. This logical name is also available as a configuration parameter:
To distinguish builds started on a default and a non-default branch, there is an additional boolean configuration parameter which allows differentiating these cases:
For Git and Mercurial, TeamCity provides additional parameters with the names of VCS branches known at the moment of the build start. Note that these may differ from the logical branch name as per branch specification configured. This VCS branch is available from a configuration parameter with the following name:
<VCS_root_ID> is the VCS root ID.
Returns the human-friendly description of how the build was triggered.
If the build was triggered by a user, the username of this user is reported. When a build is triggered not by a user, this property is not reported.