Access BUILD_NUMBER of one build configuration in another
I have 2 build configurations A, B where B has to be triggered after successful completion of A. 'A' has a step where it copies a folder with its BUILD_NUMBER, i want to use the value of A.BUILD_NUMBER in one of the build step of 'B'.
I read we can achieve it through overriding dependency properties, as not much familiar with teamcity wanted to where we have to configure the parameters and how to change them and access.
Please sign in to leave a comment.
Hi Hiran,
You don't need to *override* dependency properties, but just to use them.
First, for them to be available at all, you must set up a dependency between both the configurations. In your scenario, it makes sense to set a dependency on B to A. This, in fact, will also make it so that every time you trigger B, A will automatically be triggered as well (or reused in case a suitable build of A is already available and you have checked the box to do so). In this case, it would also make sense to move your triggers to B, instead of leaving them in A
Once the dependency is set up, you can use a command line (or any other scripting language) step to perform your script that does the copy, and access the build number as "%dep.<build_config_id>.build.number%" (including the %, not the quote marks)
More information on dependencies here: https://confluence.jetbrains.com/display/TCD10/Snapshot+Dependencies
More on dependency parameters: https://confluence.jetbrains.com/display/TCD10/Predefined+Build+Parameters#PredefinedBuildParameters-DependenciesProperties
Hope this helps, if you have any other question please feel free to ask.