Pass down parameters in composite build
Hi everyone,
I have a composite build named S
This composite build has one artifact dependency (from build A) (this builds my product), and 4 snapshot dependencies (B, C, D, E) (those are testing my product))
B, C, D, E all have a snapshot and artifact dependency on build A too, since they're testing it.
This works fine, as when I trigger on build on S, first it builds A, then B/C/D/E in parallel, then aggregates everything in S.
In summary, this looks like this :
Now my issue is :
I added a prompt select parameter in S named “test_options” that allows our users to chose which test build they want to perform (B, C, D and / or E)
How do I access this “test_options” parameter in B/C/D/E, or even A, so I can make a condition to execute or not the various build steps ?
I tried playing with overriding parameters (see this post), but I don't want to override it, I just want to access the value to make a condition on it.
Thanks !
Please sign in to leave a comment.
Hi! To pass a parameter value from S to upstream builds, add the
reverse.dep.*.
prefix to your parameter name, for example:reverse.dep.*.required_dependencies
. This will set therequired_dependencies
parameter in all upstream builds (A, B, C, D, and E) to the specified value. In the build steps of those configurations, you can add an execution condition like "required_dependencies contains B". The step will only run if B is contained within the parameter value %required_dependencies%.Related docs:
https://www.jetbrains.com/help/teamcity/use-parameters-in-build-chains.html#Override+Parameters+of+Preceding+Configurations
https://www.jetbrains.com/help/teamcity/build-step-execution-conditions.htmlAlso, you may want to watch for the optional dependencies feature that is currently in the works:
https://youtrack.jetbrains.com/issue/TW-65341/Execute-a-dependency-basing-on-condition
Works perfectly, thank you so much !
Seems like I didn't quite understand how reverse parameters work.
Thanks for the upcoming feature, i'll keep an eye on it, it will help remove all conditions in my build steps.