Concurrent Finish Build Triggers are ignored
Hi,
We have over 30 TeamCity build configs for various tasks, and I want to report in other tools the status of those builds. So I created a separate config with a custom command-line script and a Finish Build Trigger for each one of those ~30 other configs. Within that reporting config I use the %teamcity.build.triggeredBy% variable to link back to which build triggered this one, and do the reporting accordingly. There is no snapshot or artifact dependency. So far so good.
I really like this approach, because I do not need to edit the ~30 other configs to add a reporting step. Sometimes the reporting itself fails, and I do not want to affect the status of the "real" builds.
The problem is when several of the "real" builds finish roughly at the same time. The first to finish will invoke the Finish Build Trigger of my reporting job. But while that job is running, other Finish Build Triggers are ignored. I would have expected those additional triggers to queue new reporting builds instead.
Is there a way to avoid "missing" those build triggers?
Thanks for your help!
Please sign in to leave a comment.
Hi Alex,
while a build is running, new instances can be started, but if multiples are attempted to be added to the queue at the same time, TeamCity will "optimize" them.
The easiest way here would be to do it slightly differently. Create a build template for your last task, and instead of 30 finish build triggers, it would be safer to create 30 instances of build configurations that inherit from the template, and that each is tied to each of the configuration. Then simply add them via snapshot dependencies. You can share all the configuration via the template, parametrize the specifics of the separate reporting needs, and still, if something goes wrong, have a clear visual on what it is. They won't affect the status of the "real" builds, but will give you the information at a glance whether reporting something on some of them has failed.
Hi Denis, thank you for your reply.
I figured I would probably need separate configs and snapshot dependency... But good idea to use a template for the reporting jobs, it will make maintenance easier but will also keep "reporting" and "real" builds separate.
If I go with this approach, do I need to add both a Snapshot Dependency and a Finish Build Trigger in the reporting jobs, or is just the Snapshot Dependency sufficient?
The "real" jobs are already triggered normally, from VCS changes etc. I do not want the reporting builds to trigger new upstream builds.