Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How/Where to set reverse dependency parameter (reverse.dep) in TeamCity?

I have a TeamCity build configuration A and B, where B is dependent on A. I need to pass a parameter from B to A when B is triggered.

This is related to question: Override dependencies properties by parameters value in TeamCity 9

and the teamcity documentation here

I need to find WHERE/HOW to use this reverse.dep to set the parameter in the dependent build? In the Project Configuration Parameters section, I can add Configuration/Environment/build parameters, but they take a Name/Value pair. So, pardon my ignorance here, but am not able to make out where to specify this reverse logic.

Thanks

like image 436
sppc42 Avatar asked Jun 16 '16 10:06

sppc42


People also ask

What is configuration parameters in TeamCity?

Edit page. Last modified: 17 October 2022. Build parameters are name-value pairs, defined by a user or provided by TeamCity, which can be used in a build. They help flexibly share settings and pass them to build steps.

How do I find my TeamCity build ID?

In Java, we can get currently running teamcity build number as follows: String tc_BuildNumber = System. getenv("BUILD_NUMBER"); This is because TC provides an environment variable namely BUILD_NUMBER.


2 Answers

Found it!

We just need to add a new Configuration Parameter in B with name as reverse.dep.<btId>.paramName and its value as the intended value that needs to be passed.

Imp: As noted in the TeamCity documentation -

As the parameter's values should be known at that stage, they can only be defined either as build configuration parameters or in the custom build dialog.

like image 198
sppc42 Avatar answered Dec 06 '22 20:12

sppc42


you have to use this argument reverse.dep.*.<parameterName> into your build configuration to be consumed by the dependent builds.

for instance, if A depends on B, so if you trigger B and you want to use parameter defined in B into A, then simply add new parameter with name "reverse.dep.*.<parameterName>" Value: <Value> in Configuration Parameters of B and then you can use this parameter with %parameterName% into A build CLI or anywhere.

like image 42
karan kural Avatar answered Dec 06 '22 20:12

karan kural