How do Build Trigger Rules Work?

I think I understand from the text that the Build Trigger Rules are exclusionary.  That is, whatever is entered in the text area is excluded from triggering a build, so long as the pattern matches.  (Correct?)

We are using TFS, and for reasons I don't want to go into, we do our Checkout from a folder that is at least on level above the actual code project level; imagine:

$/TeamProject
    +Development
        +Project1
        +Project2
        +Project3
        +Project4

What I have is that Solution1 contains Project1 and Project3 (but not Project2), and another Solution that contains Project2 and Project3 (but not Project1).

As it is, the Checkout Directory has to be $/TeamProject/Development for both Builds and whenever any file is checked-in (even in Project4), both Solution1 and Solution2 builds happen.

How do I set it up so that builds for Solution1 are only queued when Project1 and Project3 have checkins?

If you can provide an actual text entry for the Build Trigger Rule, using my example that would be great (assuming the Build Trigger Rule is the way to go).

Thanks for your help - Jon

13 comments
Comment actions Permalink

You probably need something like this:

for Solution1

+:.
+:Project4
-:Project2

for Solution2

+:.
+:Project4
-:Project1


Usually TeamCity assumes that all folders are included (+:. is the default rule). But this logic is disabled once a '+' rule with a folder is used. That is why I added +:. rule explicitly.

--
Pavel Sher

0
Comment actions Permalink

Hey Pavel,

In my case, there are 10 folders under $/TeamProject/Development (which as you'll recall, is the Checkout dir).

The projects' folders are subservient to those 10 parent folders.  Consider the following environment:

$/TeamProject
     Development
          Console
               Project1
               Project2
               Project3
          Web
               Project4
               Project5
               Project6
          Models
               Project7
               Project8
               Project9

Solution1 requires Project2, Project5 and Project8.

Can I say:

+:.
-:.\Console
+:.\Console\Project2
-:.\Web
+:.\Web\Project5
-:.\Models
+:.\Models\Project8

Thanks for any additional pointers - Jon

0
Comment actions Permalink

I tried the pattern that I outlined in my reply but checkins to the $/TeamProject/Development/Console/SomethingElseCompletely still fired a build despite the -:./Console rule

What am I doing wrong?

Thanks - Jon

PS - Should I simply do:

-:.
+:./Console/Project2
+:./Web/Project5
+:./Models/Project8

??

Message was edited by: Jonathan Harley

0
Comment actions Permalink

My latest attempt simply stops everything.

What am I missing?

0
Comment actions Permalink

Next week we will try to investigate this issue. Right now most of our developers are on holidays. Sorry for delay.

0
Comment actions Permalink

Hey Pavel,

I am still waiting for the vacationing developers to come back and give me a clue..

Thanks - Jonathan

0
Comment actions Permalink

Once again, sorry for delay. Please remove ./ or .\ from your rules. The following rules work just fine for me:
+:.
-:Console
+:Console\Project2
-:Web
+:Web\Project5
-:Models
+:Models\Project8

0
Comment actions Permalink

Hey Pavel,

Thanks for the reply.

Will -:. remove all projects?  Then I could simply add the ones I want instead of subtracting each parent then adding a specific child.

I'm suggesting the following:

-:.
+:Console\Project2
+:Web\Project5
+:Models\Project8

Thanks - Jon

0
Comment actions Permalink

I think this should work.

0
Comment actions Permalink

It would be cool if there was a way to test the build trigger without actually running the build. Something that just outputs a listing of all items included in the given trigger.

0

Please sign in to leave a comment.