Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 882
jakejgordon Avatar asked Nov 04 '22 00:11

jakejgordon


1 Answers

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/\*\.
like image 176
Nathan Stohlmann Avatar answered Nov 09 '22 14:11

Nathan Stohlmann