3

I'm trying to set up TeamCity 8.1.5 configurations so that a project is built, but the test step only runs if certain source files were touched. So ideally two configurations. What I'm seeing is that if my second cfg has a FinishBuild and a VCS trigger with some source file rules, it gets triggered for all cases. (The triggers seem to be or'd.)

I can get around this by using three configurations, one for the build (no triggers), a second one for test with a dependency on the build snapshot and with the source file rules as a trigger, and a dummy one with a dependency on the build snapshot and the source file rules trigger inverted.

No way to do this with only two configurations? I hate to have the source file rules in two places.

1 Answers1

1

You only need two builds.

Build: Has a VCS trigger Test: Has a VCS trigger with rules to only trigger for certain folders. Snapshot dependency on Build.

Instead of VCS checkout rules, you want to be just setting the rules on the trigger. You don't need any final build triggers.

If a commit contains changes which shouldn't trigger Test, just the Build configuration is triggered. If a commit contains changes which should trigger Test, Build is added to the queue first.

infojolt
  • 5,244
  • 3
  • 40
  • 82
  • Thanks. On trigger, turn off "Trigger on changes in snapshot dependencies" and uncheck "Per check-in triggering". – user1858623 Oct 06 '15 at 05:41