2

I have a rule in Build Triggers to not trigger a build if a commit happens on a directory:

Here is the directory structure of our code

web      => Web Application code. Should trigger Build1
api      => Backend Code. Should trigger Build2

When a git commit happens on web files, I just want to trigger Build1 and not Build2. So, I have the trigger rules setup this way:

+:.
-:api/**

This worked for couple hours, but I started seeing both builds getting triggered when api files are checked in and vice versa.

I have also tried the following configurations and nothing seem to work.

Config2:

-:api/**

Config3:

+:web/**

Config4:

-:**
+:web/**

Config5:

-:.
+:web/**

Whats the right build trigger config for my usecase?

This happens both on Teamcity 8 and 9

Rahul
  • 903
  • 8
  • 16
  • Are you using checkout on an agent? Apparently there are limitations around checkout rules with Git and you can only map the entire repository to a directory (https://confluence.jetbrains.com/display/TCD9/Git#Git-Limitations). – tspauld Mar 13 '15 at 21:41
  • I do checkout on agent, but I don't have any checkout rules – Rahul Mar 13 '15 at 21:57

2 Answers2

2

You don't need the wildcards, and if you use a + rule you don't need the -:. rule. This should work for Build 1:

+:web/**

This should work for build 2:

+:api/**
Biswajit_86
  • 3,661
  • 2
  • 22
  • 36
tspauld
  • 3,512
  • 2
  • 25
  • 22
-1

I assume you are aware of this site: https://confluence.jetbrains.com/display/TCD9/Configuring+VCS+Triggers#ConfiguringVCSTriggers-VCSTriggerRules

You can start playing with single file, trying to figure it out if it is still triggering both builds.

Krzysztof Wolny
  • 10,576
  • 4
  • 34
  • 46