Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setting up TeamCity to pull multiple git repos with named locations

Tags:

git

teamcity

I am having a problem creating a TeamCity project build that relies on two git repos. In particular, there is content in a primary that relies on a shared repo. This isn't ideal and needs to change (aka pushing all shared components into nuget), but first things first.

The build machine needs two sibling checkout folders: 'Project' and 'Shared'. Then, from the 'Project' folder, I want to kick off a rake task.

Teamcity seems to pull the first 'Project' repo, checksout to the /work folder then deletes it and replaces it with a checkout from the 'Shared' repo.

Any ideas on how to get this pulling properly?

Thank you, -Steve

like image 842
S. Hebert Avatar asked Dec 20 '12 19:12

S. Hebert


2 Answers

I found that I can move the entire tree by setting the VCS Root 'Checkout rules' on the repository definition by using the following rule entry:

+:.=>./Shared

This rule says effectively "for the root folder of this repository and everything under it, move it all under a folder called 'Shared'.

I then do the same for the 'Project' repo, moving it to the 'Project' folder and I now have two discrete sibling folders setup under the workspace at build time.

like image 138
S. Hebert Avatar answered Nov 02 '22 02:11

S. Hebert


I did not get much from your question. What I understood is that you have code in 2 repos and you want to pull them into a single folder. In such situation I would either use git submodules or git subtree merge.

Reference at http://git-scm.com/book/en/Git-Tools-Submodules

Submodules: Chapter 6.6

Subtree Merging: Chapter 6.7

like image 1
ShadyKiller Avatar answered Nov 02 '22 01:11

ShadyKiller