How to get the build number from other build configuration (for example B) without increasing the B build number in Teamcity

49 Views Asked by At

I have 2 build configuration named A and B.I want to use the build number of build config B in the build step of A. And I don't want a change to be made in the build number of B (that is, it won't be built again.) Only when the build number of B is changed, there is a real change in project B.

i tried snapshot dependency, but it doesn't work.

1

There are 1 best solutions below

0
Evgeny  Bovykin On

To get the dependency property, you can use %dep.<DependencyExternalId>.<property.name>% syntax. In your case, <property.name> would be build.number, so %dep.<DependencyExternalId>.build.number%.

You mention that you tried snapshot dependency and it didn't work. It's not clear what you mean by that, but the common case could be that even though A depends on B, when B is finished, A will not be triggered automatically. You need to either trigger A instead of B (and since B depends on A, A will be triggered too or reused if possible), or use a finish build trigger in A