Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download only part of a GitHub repository on a TeamCity build server

So I have a GitHub repository with multiple .NET projects. My TeamCity currently downloads all the code, but then builds only the few projects I need. Is there a way to make it only download part of the repository?

like image 242
me_ Avatar asked Feb 10 '12 10:02

me_


2 Answers

You just need to setup your VCS roots once, and don't have to create one per project.

Then, for a given project, you need to edit checkout rules in the administration page.

  1. Go to {TEAMCITY_URL}/admin/editBuildTypeVcsRoots.html?id=buildType:bt{PROJECT_ID}
  2. Click on the link "edit checkout rules (0)"
  3. Add the two following rules:
    -:.
    +:path/to/your/project/in/github
    

This way your project configuration will checkout only the relevant part of your github repository.

You can have more details about the checkout rules in the Teamcity documentation.

like image 194
Sébastien Saunier Avatar answered Nov 05 '22 06:11

Sébastien Saunier


Just adding to what Sébastien Saunier wrote above: If you want that sub folder in Github to become your root folder of the build folder, than you have to add =>.

For Example:

-:.
+:subfolder=>.

Hope this helps, Guy

like image 25
Guy Burstein Avatar answered Nov 05 '22 06:11

Guy Burstein