Is it possible to get two builds to checkout on the same directory and how can this be done please?
Currently the two different builds are checking out to two different directories.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can accomplish this by taking control of the checkout directory locations.
First you need to define your checkout directory to something that can be known to both builds. In your build configuration, browse to Version Control Settings -> Checkout Settings. Change the Checkout Directory setting to
Custom Path. You’ll then be prompted to provide the directory to which you want to checkout your source. This can be anywhere you want**, as long as TeamCity has write privileges there.Next, you need to modify the Checkout Rules (also on Version Control Settings) for each project such that they are targeting a folder relative to the root of the Checkout Directory. You can do this by setting the rule to
+:%some.repo.path%=>/%some.sub.folder%. You could prescribe any subfolder you want there. We just checkout everything to the Checkout Directory root (=>/).If both projects are referencing the same Checkout Directory, then this combination of setting should give you the control and flexibility that you’re looking for.
** For our Checkout Directory we use the parameterized value
%teamcity.agent.work.dir%\%system.teamcity.projectName%\%branch%. The first two parameters are TeamCity system parameters, and the the last is defined by us. On our system this resolves to G:\BuildAgent\work\$PROJECT\$BRANCH, which keeps everything tidy and predictable.