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 by referencing Build Configuration Properties. Build Configuration Properties are either user-defined or predefined.

In this section:

Defining Properties



The system properties and environment variables required for a build configuration can be defined in three locations. Where these properties and variables are set will determine whether they affect a specific build configuration, all of a project's build configurations that use the same VCS root, or a specific Build Agent.

  • To define properties specific to a build configuration, enter them on the Build Configuration's 6.Properties and environment variables page.

  • To define properties for all of a project's build configurations that use the same VCS root, create a text file named teamcity.default.properties, and check it into the VCS root. Ensure the file appears directly in the build working directory by specifying appropriate Configuring VCS Settings. The name and path to the file can be customized via the teamcity.default.properties property of a build configuration. Properties defined this way will not be visible in the TeamCity web UI, but will be passed directly to the build process.

  • To define agent-specific properties edit the Build Agent's buildAgent.properties file (<agent home>/conf/buildAgent.properties). (see agent below)

    note

    Note that properties and variables entered on the build configuration's page take priority and will supersede the values entered in the teamcity.default.properties and buildAgent.properties files. Likewise values set in the buildAgent.properties file will supersede values set in the teamcity.default.properties.

    note

    Default build properties loaded from teamcity.default.properties are logged into the agent's log, but not to the build log.

    The system properties and environment variables are defined in the teamcity.default.properties and buildAgent.properties files using the following format: [env|system].property_name=property_value For example: env.CATALINA_HOME=C:\tomcat_6.0.13

  • env. properties define the environment variables used during the process of running the build. These consist of the environment variables of the agent running the build, the environment variables defined in the agent configuration and the TeamCity default properties files and the environment variables set for the build configuration on the 6.Properties and environment variables page when you Creating and Editing Build Configurations. Please note that the agent's environment variables can vary depending upon which user the agent process is running. The list of environment variables available on a specific build agent can be found on the Environment variables tab of the Agent Details page .

  • system. properties include the properties defined on the 6.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.

Referencing Properties



On the build configuration administration screens the properties can be referenced by %system.<property name>% and %env.<property name>%. Only the properties defined on agent and in the build configuration itself can be referenced.

Any user-defined property can reference other properties by using the following format:

%[env|system].property_name% For example: system.tomcat.libs=%env.CATALINA_HOME%/lib/*.jar

An exception to this is the teamcity.build.checkoutDir, which is referenced as is, without prefixes.

Any Global and system property (system.*) can be referenced in a build script by the property name:

  • For Ant and NAnt use ${<property name>}

  • For MSBuild (Visual Studio 2005/2008 Project Files) use $(<property name>)

    note

    Don't forget to leave the "system." part out of the system properties.

    note

    When using MSBuild, remember to replace "." with "_" when you reference property names.

Any user-defined environment variable is passed to the environment of the build agent that will process 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 Agent Requirements for the configuration. The build configuration will be run only on agents that have this property defined.

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 6.Properties and environment variables section of Build Configuration settings in TeamCity Web UI.

Agent-specific



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 TeamCity NUnitLauncher utility and adds the corresponding system properties and environment variables. (A complete list of predefined properties is provided in tablePredefinedProperties and listOfPredefinedProperties below). If additional applications/libraries are available in the environment, the administrator can manually define the property in the buildAgent.properties file (<agent home>/conf/buildAgent.properties). These properties can be used for setting various build configuration options, for defining build configuration requirements (e.g. existence or lack of some property) and inside build scripts. For more information on how to reference these properties see ref above.

Here is the complete list of supported predefined 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

  • VS2003

  • VS2003_Path

  • VS2005

  • VS2005_Path

  • VS2008

  • VS2008_Path

You can disable the autodetection of these predefined properties by editing the buildAgent.properties file and adding the disableDotNetDetection property. Please note that this property is case-sensitive.

This property can have the following values: