Can we filter out some commits from pending changes (and not trigger builds) by repo subfolder?

We have multiple projects that share a common git repo.  The repo has a folder structure setup something like this:

     - root
     +    Project1
     +    Project2
     +    Commons

So the two projects share a lot of code via Commons.  However they each have their own dedicated builds.  We want project2 to build anytime code in either folder Project2 or Commons is committed, but it should not build if commits only affect the Project1 folder.

And in particular, we don't want commits that only affect files under Project1 to show up in the pending changes of Project2.

How can we accomplish this with TeamCity?

4 comments
Comment actions Permalink

Checkout rules do that - they provide additional filters and mappings within the single VCS root.

0
Comment actions Permalink

I've playing around with that, and it does seem to be doing what I want.  Thanks.

I actually checkout rules before but it wasn't working, probably because at the time we were using agent side checkout.  

0
Comment actions Permalink

Checkout rules can work even with agent-side checkout, but they have limitations:

VCS Checkout Mode

  • "Exclude" VCS Checkout Rules in most cases cannot improve agent checkout performance because an agent checks out the entire top-level directory included into a build, then deletes the files that were excluded. Perforce and TFS are exceptions to the rule, because before performing checkout, specific client mapping(Perforce)/workspace(TFS) is created based on checkout rules.
  • "Exclude" VCS Checkout Rules are not supported for Git when using checkout on agent due to Git limitations.
0
Comment actions Permalink

There it is.  The caveat about git agent side checkouts is the problem I had.  Switched to server side checkouts and it's working like a charm so far.  Thanks for the pointers.

0

Please sign in to leave a comment.