snapshot dependency builds with differing parameters

Hi All, following situation on Teamcity 2020.1:

I want to use a single teamcity build configuration to trigger the same packaging build 3 times for 3 environments (dev, uat, prod) each time setting an environment configuration parameter differently (using the functionality reverse.dep.*.environment).

It seems this is not possible directly in the snapshot dependencies so I defined 3 dummy inbetween builds instead, each with the config parameter reverse.dep.*.environment set appropriately, and each having a snapshot dependency to the packaging job.

Then I added these 3 jobs as snapshot dependencies to the main job I trigger manually, "package all".

In this configuration Teamcity starts the 3 inbetween builds fine, but only starts the base packaging job once, even though the logic would dictate that it needs to be started 3 times, since it is configured differently from each of the intermediate jobs that depend on it.

This behaviour seems to be irrespective of whether or not I select "Do not run new build if there is a suitable one" in the snapshot dependencies.

Is there any good solution to this? Many thanks!

1 comment
Comment actions Permalink

I suppose people will say I should put the packaging logic in a template and then derive 3 build configs. from that... that would be an option I guess, but less transparent since someone looking at the build chain would not necessarily know without further investigation whether the 3 builds were similar. So I'd be interested to know if Teamcity can do more complex dependency analysis, or how it determines whether an existing build is "suitable", but if there is no better solution I guess I'll go the template route.

Many thanks!


Please sign in to leave a comment.