3
votes

I'm using TeamCity 6.5.1 with one project and about 10 build configurations. I have a dependency chain akin to Core -> Framework -> Apps. Framework has a dependency on Core, and the Apps depend on both Core and Framework.

The issue I am having is that the framework/apps are not being triggered after the core has been triggered and built successfully. I have selected "Trigger on changes in snapshot dependencies" on the framework and all the apps, but none of them seem to trigger even though the core build was triggered from an SVN commit.

Does "Trigger on changes in snapshot dependencies" not work the way I think it does? Do I need to add the core (and framework) VCS roots to the VCS trigger on the framework/apps? If that is my only option I suppose I could do it that way, but it seems redundant (especially if I need to adjust VCS root paths in the future).

Core VCS Trigger:

+:root=MySVNRoot:/Core/**

Framework VCS Trigger (snapshot dep. on Core):

[x] Trigger on changes in snapshot dependencies

+:root=MySVNRoot:/Framework/**

App VCS Trigger (snapshot dep. on Core and Framework)

[x] Trigger on changes in snapshot dependencies

+:root=MySVNRoot:/Applications/MyApplication/**
4

4 Answers

0
votes

Decided to use "Finish Build" triggers on the framework and apps configurations. I would prefer that the VCS trigger worked in the way described above, but I'll go with this until someone can suggest a better alternative (or if "Finish Build" triggers really are the best option).

Framework triggers:

VCS trigger
Finish Build trigger on Core

App triggers:

VCS trigger
Finish Build trigger on Framework
0
votes

For any dependency cases the feature to use is snapshot dependencies. In your case you should probably add TeamCity snapshot dependency from Framework to Core and from Apps to Framework. After that "Trigger on changes in snapshot dependencies" option will start working triggering Framework and Apps on any change in Core.

0
votes

Your Framework VCS Trigger (snapshot) should be the same as core, you want it to TRIGGER the build when Core source changes

+:root=MySVNRoot:/Core/**

App VCS Trigger should be against Core & Framework VCS

+:root=MySVNRoot:/Core/**
+:root=MySVNRoot:/Framework/**

These settings are much easier in TeamCity 7

0
votes

The "Trigger a build on changes in snapshot dependencies" feature sort of does the opposite of what it sounds like. For me the desired outcome was like this:

Apps depends on Framework depends on Core
Change in Framework -> Build Framework -> Build Apps
Change in Apps -> Build Apps
Change in Core -> Build Core -> Build Framework -> Build Apps

I wanted changes in Core to trigger a build for Framework, and ultimately Apps, but I did NOT want a change in Framework to trigger a change in Core, while still triggering a build in Apps.

That is what it sounds like the "Trigger a build on changes in snapshot dependencies" feature would do, but in reality what it does is trigger a build at the beginning of the chain, regardless of which project the change occurred in:

Change in Apps -> Build Core -> Build Framework -> Build Apps
Change in Framework -> Build Core -> Build Framework -> Build Apps
etc...

That would mean if you changed something in Apps, you would trigger a build in Core and through snapshot dependencies, it would ultimately build everything in the chain. I think the reason that didn't work for you is because that trigger has to be set in Apps, with no triggers on any of the other projects.

Unfortunately, I think the only way to achieve the behavior I described is to have a VCS Trigger and Finish Build trigger on each dependent project, and a quiet period so you can independently trigger builds from somewhere in the middle of the chain without triggering the entire build chain.