TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

System Properties of a Build Configuration

Last modified: 20 April 2023

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

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:

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.