Search code examples
teamcityteamcity-9.0

Dynamically changing 'teamcity.build.branch'


I want to set the value of 'teamcity.build.branch' dynamically according to the result of another TC build configuration part of the build pipeline.

Is that even possible? It looks like the value is evaluated and used at the start of the build pipeline.

UseCase:

  • I am executing a TC build configuration that will generate a unique number
  • in the connected TC build configuration part of the same pipeline I want the number to be used in the 'teamcity.build.branch' - just for visualization purposes

I am already using message service to overwrite the parameter, but the change is not taken into account. It looks like the value is read in the very early stage of the build process.


Solution

  • Check below reference containing build number and git branch name

    https://octopus.com/blog/teamcity-version-numbers-based-on-branches