System Properties of a Build Configuration
Last modified: 20 April 2023Various build configuration settings can be defined using references to Build Configuration Properties. Build Configuration Properties are user defined or predefined.
In this section:
User-defined Properties
Properties specific to a build configuration can be defined on Properties and environment variables page of Build Configuration. Properties specific to a build agent can be defined in the <buldAgentHome>/conf/buildAgent.properties file in the form
[env|system].property_name=property_value
Any user-defined property can reference other properties in the form
%[env|system].property_name%
env. properties resolve to the environment variables of the process running the build. These consist of environment variables of the agent running the build, environment variables defined in the agent configuration file and environment variables set for the build configuration on the Properties and environment variables page when you Creating and Editing Build Configurations. Please note that environment variables of the agent depend on the user under which the agent process is running. The list of environment variables available for an agent can be seen on the Agent Details|Environment variables page for this agent.
system. properties include the properties defined on the Properties and environment variables page in build configuration area of TeamCity, agent-specific predefined properties as well as system properties defined in the agent configuration file.
Predefined Properties
Global
These properties can be used for setting various build configuration settings and inside build scripts.
Property Name | Value |
---|---|
build.working.dir | working folder in which build is started |
build.number | build number assigned by TeamCity |
build.vcs.number.XX | VCS changelist number, where XX is the number of VCS root (1, 2, etc.) Use build.vcs.number.1 if only one VCS root is configured for a project Please note that the value is VCS-specific (e.g. for SVN the value is a revision number) |
For a full list of supported properties please refer to the Properties and environment variables section of Build Configuration settings in TeamCity Web UI.
Agent-specific
Agent-specific properties are defined by each build agent depending on its environment. Aside from standard properties (e.g. os.name or os.arch, etc.) agents also can set properties depending on installed applications. If the corresponding application/library is found in the environment, the property is defined, otherwise the property is not defined. These properties can be used for setting various build configuration options, for defining build configuration requirements (e.g. existence or not existence of some property) and inside build scripts.
These properties can be referenced by
%system.<property name>%
TeamCity automatically detect the presence of .NET Framework on the agent and sets corresponding properties in the form:
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. |
DotNetFramework<version>[_x86|_x64] | Property is defined if corresponding framework version is installed |
DotNetFramework<version>[_x86|_x64]_Path | Property's value is set to the path of corresponding framework version |
DotNetFrameworkSDK<version>[_x86|_x64] | Property is defined if corresponding framework SDK version is installed |
DotNetFrameworkSDK<version>[_x86|_x64]_Path | Property's value is set to the path of corresponding framework SDK versi |
tip
_x86 and _x64 properties suffixes are used to designate specific version of the framework.
Here is the full list of supported properties:
DotNetFramework1.0,
DotNetFramework1.0_Path,
DotNetFramework1.0_x86,
DotNetFramework1.0_x86_Path,
DotNetFramework1.1,
DotNetFramework1.1_Path,
DotNetFramework1.1_x86,
DotNetFramework1.1_x86_Path,
DotNetFramework2.0,
DotNetFramework2.0_Path,
DotNetFramework2.0_x86,
DotNetFramework2.0_x86_Path,
DotNetFramework2.0_x64,
DotNetFramework2.0_x64_Path,
DotNetFramework2.0_x86,
DotNetFramework2.0_x86_Path,
DotNetFrameworkSDK1.0,
DotNetFrameworkSDK1.1,
DotNetFrameworkSDK1.1_Path,
DotNetFrameworkSDK1.1_x86,
DotNetFrameworkSDK1.1_x86_Path,
DotNetFrameworkSDK2.0,
DotNetFrameworkSDK2.0_Path,
DotNetFrameworkSDK2.0_x86,
DotNetFrameworkSDK2.0_x86_Path
tip
Please refer to Agent Details|System properties page of the TeamCity web UI to see properties defined on particular agent.
Referencing Properties
On build configuration administration screens the properties can be referenced by %system.<property name>% and %env.<property name>%. build.working.dir is a special case and it is referenced as is, without prefixes.
Any Global and system property (system.*) can be referenced in a build script by the property name. e.g. for Ant, use ${<property name>} Do not forget to leave out "system." part of the system properties.
Any user-defined environment variable is passed to the environment of process running the build and can be used there as a usual environment variable.
Any property that is referenced in a build configuration, but is not defined, becomes a Basic Concepts for the configuration. The build configuration will be run only on agents that define the property.
Thanks for your feedback!