Sync configuration parameters in a build chain in TeamCity
Use the same parameter values for dependency builds
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.
-
Now go under
General Settings -> Build number format
enter%version_name%.%build.counter%
-
Follow step 2 for all dependency builds
The final output should be something like this