Pass branch name to Snapshot Dependency in TeamCity

那年仲夏 提交于 2019-12-11 16:43:14

问题


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:


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



来源:https://stackoverflow.com/questions/49637591/pass-branch-name-to-snapshot-dependency-in-teamcity

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!