| You are viewing documentation of TeamCity 5.x, which is not the most recent released version of TeamCity. Please refer to the listing to choose another version. |
|
Build configuration templates are intended to eliminate duplicating settings of the build configuration. You can create a build configuration template in two ways:
When a template is created, you can associate with it any number of build configurations. If a build configuration is associated with a template, then settings of this build configuration are inherited from the template. However, some settings can be redefined; for more details see Changing Parameters in Associated Configuration section below. When you detach build configuration from a template, all settings from the template will be copied to the build configuration and enabled for editing. Template which has at least one associated build configuration cannot be deleted. Changing Parameters in Associated ConfigurationAs mentioned above, if a build configuration is associated with a template, then settings of this build configuration are taken from the template by default. However, it is possible to override some settings on the build configuration level:
Currently, re-definition is not available for the following settings:
Using Parameter ReferencesTeamCity allows using configuration parameters with %param.name% syntax in the template text fields thus providing means to change actual values of such parameters in attached configuration itself. To create new configuration parameter, use 6.Properties and environment variables section of the template settings. When a parameter created, you can reference it in any template's text field. You can either specify parameter's default value or leave the value blank. If configuration parameter has a default value, then this value will be used in associated build configuration, unless you change it manually in the particular build configuration itself. Example of Configuration Parameters UsageThe following example shows how the configuration parameters work. Assume that you have two similar build configurations that differs only in checkout rules. For instance, let's say for the first configuration checkout rules should contain ':release_1_0 => .', and for the second configuration — ':trunk => .'. It would be useful to have one build template to associate with both configurations. In this case you will need means to change checkout rules in each build configuration itself. To solve the task, you need to perform the following procedure:
The task is solved: we have two build configurations associated with one template and individual checkout rules. In such manner you can create a configuration parameter and then reference it from any build configuration, which has a text field.
See Also: |