How to pass a parameter to nested dependencies
Answered
I have a build A which has a dependency on build B and build B which has dependency on build C i.e A->B->C.
Now I want to pass a parameter from build A to its dependent builds B and then to C, such that if that particular parameter which is defined in build A is set to false then only dependent builds B and C should run. Please let me know how can I achieve this?
I know we can pass parameters to dependent build through reverse parameters : reverse.dep.<btID>.<property name> such that I will define parameter
reverse.dep.<btID>.<propertyname> within Build A and define <propertyname> within Build B but how can I pass same dependency parameter within Build C?
Please sign in to leave a comment.
Hello!
You can define the parameter for C configuration directly from A configuration; below parameter:
will set <propertyname> for C equal to <value>, even if A does not depend directly on C (e.g. A -> B -> C scenario).
If both A and B define a parameter for C, and A depends on B, A value will be used. If A does not depend on B, parameter in C will be modified and instead two conflict.<btId>.<propertyName> parameters will be created. You can see more details on the logic on the dependency properties article: https://www.jetbrains.com/help/teamcity/predefined-build-parameters.html#Overriding+Dependencies+Properties
I hope this helps.