Configuring TeamCity checkout rules against GitHub repository

I've a repository on GitHub called FruityRepo. Inside FruityRepo I have two Visual Studio solutions, one called Fruit.Apple and another called Fruit.Pear.
I'm configuring TeamCity to build both solutions, so I've created a couple of projects inside TeamCity. I only want TeamCity to pull down the Pear code when Pear changes, and likewise for Apple.
However I'm unsure what the format of the checkout rule needed to make this work. I think I need two rules, something like;

-:.
+:Fruit.Pear


This does not work though, TeamCity returns the error Cannot start build runner.
How do I configure a checkout rule in TeamCity against GitHub?

1 comment
Comment actions Permalink

Hi Stuart

You get the error because the sources are checked out to a subfolder <checkout directory>\Fruit.Apple\, but MSBuild is looking for a project file right in the root directory like <checkout directory>\Fruit.Apple.csproj.
You need not only filter the sources, bua additionaly redirect them to alternate location.

The right syntax is

+:Fruit.Apple=>. 

and

+:Fruit.Pear=>.



Also, you don't need to explicitly exclude everything in the first line, if the next line includes one of subfolders.

More details and examples can be found in VCS Checkout Rules article of TeamCity documentaion.
0

Please sign in to leave a comment.