132 words
1 minute
Sync configuration parameters in a build chain in TeamCity

I recently had the need to sync my configuration parameters between dependency builds. This need arosed once I started using composite builds. The goal is to have all of my builds show what version is being built. For example my app is currently on version 0.2.0, I’d like this version to by sync’d to all builds undernearth the composite build.

TeamCity has a solution to use, you can use the syntax reverse.dep.*.VARIABLE_NAME where VARIABLE_NAME is the name of the parameter you want to replace in dependency builds. The way I sync the version is as follows

reverse.dep.*.version_name=0.1.0
version_name=.0.1.0

Enter the 2 of those in as configuration parameters on the composite build.

  1. Now go under General Settings -> Build number format enter %version_name%.%build.counter%

  2. Follow step 2 for all dependency builds

The final output should be something like this

Depedency rev

Sync configuration parameters in a build chain in TeamCity
https://edwardbeazer.com/posts/sync-configuration-parameters-in-a-build-chain-in-teamcity/
Author
Edward Beazer
Published at
2023-08-10