Custom triggers for teamcity configurations

Hi,

 

Can anyone help me with the below case:

Can I setup trigger for a build configuration for 2 conditions. Means trigger should get triggered when both the conditions are true.

For example:

There is build project A which is connected to a VCS root. And there are 2 other deployment project configuration B and C.

I want that the deployment project B should only get  triggered when it finds out that there is changed / new build available in A which is dependency for B and also when deployment C got completed successfully.

So both conditions should be met before deployment B gets triggered. Is it possible in TeamCity for triggers.

Individual triggers works fine but can both of them be applied at the same time and work in "AND" scenario. That is when both triggers are true. 

0
1 comment

Hi Sudhakar,

At the moment this isn't possible per se. You can try to create your own trigger for it, or simply have a first step in B that makes the checks manually and cancels the build if it shouldn't be run.

The problem here might be, what is considered "C completed successfully and A has new changes?" From what I understand of your scenario, what you want is a trigger when C finishes, that checks whether A has pending changes and if so then triggers B. If that's the case, the finish build trigger (or even snapshot dependency) would deliver this, simply create a build step or configuration that checks for the pending changes. Help on accomplishing it available here: https://stackoverflow.com/questions/21673173/teamcity-rest-api-get-list-of-pending-changes

If you want to trigger B on every change of A but checking that C was also deployed, this is more problematic, as C could return success but from a much older build. This is the main reason that leads me to think that in your scenario, a trigger for C that as a first step checks your conditions on A would be optimal.

Hope this helps.

0

Please sign in to leave a comment.