1
votes

I have 2 repos, A and B, which both have a build configuration in TeamCity.
Changes in repo A can impact repo B. When a PR is tested on repo A (say branch R), I want to be able to start another teamcity job that tests repo B and will know about branch R. More specifically, A runs on R, B runs on Master, B has a build step that requires R as an argument for a command. In teamcity, the build config for B is a snapshot dependency for the build config of A.

This other answer showed me how to pass parameters to snapshot dependencies: Passing an environment variable (parameter) to dependency project in TeamCity
However, I can't pass the branch name like %teamcity.build.branch% because the documentation specifies:

Note that the values of the reverse.dep. parameters are pushed to the dependency builds "as is", without reference resolution. %-references, if any, will be resolved in the context of the build where the parameters are pushed to.

from: https://confluence.jetbrains.com/display/TCD9/Predefined+Build+Parameters#PredefinedBuildParameters-OverridingDependenciesProperties

1

1 Answers

0
votes

You can use a finish build trigger for B and make sure the trigger can use the same branch R.

Wait for a successful build in: A Branch filter: +:R