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

2

12

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

Kartis answered 16/6, 2016 at 10:57 Comment(2)
So A depends on something passing a parameter to it? It seems these two are mutually dependent on each other, why not have 1 build configuration that builds them both?Pagoda
@LasseV.Karlsen: A can be build independently also, where that parameter is a Prompt parameter entered by the user. When Running B though, it then needs to pass/set this parameter in AKartis
K
15

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.

Kartis answered 16/6, 2016 at 11:34 Comment(1)
you say <btId> - is that the build task ID from "A" which B depends upon?Graze
I
1

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.

Interwork answered 25/3, 2021 at 10:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.