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.
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/\*\.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With