jakejgordon
jakejgordon

Reputation: 4098

Mutually Exclusive Team City Build Triggers Both Firing

We have two separate builds configured in TeamCity against TFS with the following triggers (listed below).

Build 1:
+:Folder1/Folder2/Folder3/FilePrefix\*\*
+:Source/\*\*
+:Tests/\*\*

Build 2:
+:Folder1/Folder2/\*\*
-:Folder1/Folder2/Folder3/FilePrefix\*\*
-:Tests/\*\*
-:Source/\*\*

If we make a change to a file in Folder1/Folder2/Folder3/FilePrefix we are finding that BOTH builds trigger. The documentation states:

For each file in a change the most specific rule is found (the rule matching the longest file path). The build is triggered if there is at least one file with a matching "include" rule or a file with no matching rules.

Doesn't this mean that only the most specific rule takes precedence? Why isn't Build 2 excluding this file because of the -:Folder1/Folder2/Folder3/FilePrefix**? It seems like the +:Folder1/Folder2/** is overriding the ignore rule.

Upvotes: 5

Views: 348

Answers (1)

Nathan Stohlmann
Nathan Stohlmann

Reputation: 479

I ran into this a few weeks ago and found that we had to specify the final wildcard as a '.' instead of a '*' for negation statements.

So your trigger rules for build2 would end up looking like:

+:Folder1/Folder2/\*\.
-:Folder1/Folder2/Folder3/FilePrefix\*\.
-:Tests/\*\.
-:Source/\*\.

Upvotes: 2

Related Questions