Sync configuration parameters in a build chain in TeamCity

Use the same parameter values for dependency builds

Thu, 10 Aug 2023

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

Buy Me A CoffeeDigitalOcean Referral Badge
Loading...
Edward Beazer

Edward Beazer - I just like to build shit. Sometimes I get stuck for hours, even days while trying to figure out how to solve an issue or implement a new feature. Hope my tips and tutorials can save you some time.

DigitalOcean Referral Badge