Trigger build if artifact was created

I would like to trigger a build only if a specific artifact was created.

Let's say build X can publish two different artifacts: a.zip and/or b.zip. If a.zip is published, I want to trigger build A. If b.zip is published, I want to trigger build B.

From what I can see when setting up the trigger in builds A and B, there is no way to trigger the build only if a specific artifact is published.

Is this in any way possible?

Thanks.

0
1 comment

It feels rather strange that the same build does not produce consistently the same artifacts. I guess that it's something you control within the build, but that seems an odd choice. How are you supposed to know whether a build produces one or the other without manually checking?

The recommended approach is to set up two different build configurations, one that creates a.zip and triggers A, and one that creates b.zip and triggers B. That way, you have a fully deterministic process where you are certain that each build generates a single thing at a time.

If for some reason this approach won't work for you, it would be interesting to learn why, and there might be different options to make it work:
-Use a build trigger such as the Url build trigger: https://confluence.jetbrains.com/display/TW/Url+Build+Trigger (Please consider that we haven't really updated this in a while so it might take some changes to fully work depending on your teamcity version)
-Add a last build step to your build configuration where you check manually in a script which artifact is present, then trigger a build via the REST API of the appropriate configuration: https://confluence.jetbrains.com/display/TCD10/REST+API#RESTAPI-TriggeringaBuild
-Create your own custom trigger: https://confluence.jetbrains.com/display/TCD10/Custom+Build+Trigger

0

Please sign in to leave a comment.