TeamCity 9.0 Help

Configuring Build Parameters

Build Parameters provide you with flexible means of sharing settings and a convenient way of passing settings into the build.

Build parameters are name-value pairs, defined by a user or provided by TeamCity, which can be used in a build.

There are three types of build parameters:

  • Environment variables (defined using "env." prefix) are passed into the spawned build process as environment

  • System properties (defined using "system." prefix) are passed into the build scripts of the supported runners (e.g. Ant, MSBuild) as build-tool specific variables

  • Configuration parameters (no prefix) are not passed into the build and are only meant to share settings within a build configuration. They are the primary means for customizing a build configuration which is based on a Build Configuration Template or uses a Working with Meta-Runner.

There is a set of Predefined Build Parameters provided by TeamCity and administrators can also add custom parameters.

The parameters can be defined at different levels (in order of precedence):

  • a specific build (via Triggering a Custom Build dialog)

  • Build Configuration settings (the Parameters page of Build Configuration settings) or Build Configuration Template

  • Project settings (the Parameters page of the Project settings). These affect all the Build Configurations and Templates of the project and its subprojects.

  • an agent (the <Agent home>/conf/buildAgent.properties file on the agent)

Any textual setting can reference a parameter which makes the string in the format of %\parameter.name% be substituted with the actual value at the time of build. If there is a reference to a parameter which is not defined, it is considered an Agent Requirements so the build will only run on the agents with the parameter defined.

See more in the corresponding sections: Defining and Using Build Parameters in Build Configuration and Project and Agent Level Build Parameters.

Last modified: 20 April 2023