Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the checkout directory of project dependencies in TeamCity?

I am using TeamCity as build server and have a little trouble when configuring projects and their dependencies.

Eventually I want to get the checkout directory of project dependencies to configure certain build steps. For that I have the variable %teamcity.build.checkoutDir% for the checkout directory of the project itself.

However, I did not find something like %dep.<dependencyID>.teamcity.build.checkoutDir%.

Is there a way to get the checkout directory of a dependency?

like image 674
Stefan Avatar asked Apr 29 '15 12:04

Stefan


People also ask

What is checkout directory in TeamCity?

The build checkout directory is a directory on the TeamCity agent machine where all the sources of all builds are checked out into. If you use the agent-side checkout mode, the build agent checks out the sources into this directory before the build.

What is VCS checkout?

VCS checkout rules allow you to check out a part of the configured VCS root and to map directories from the version control to subdirectories in the build checkout directory on a build agent.

What is artifact path in TeamCity?

Artifact Paths Build artifacts are files produced by the build which are stored on TeamCity server and can be downloaded from the TeamCity UI or used as artifact dependencies by other builds.

How do you do clean checkout?

Clean Checkout (also referred to as Clean Sources) is an operation that ensures that the next build will get a copy of the sources fetched all over from the VCS. All the content of the Build Checkout Directory is deleted, and the sources are refetched from the version control.


2 Answers

You can add a parameter (say checkoutDir ) in the first build whose value is equal to %teamcity.build.checkoutDir% . You can then fetch this value in the dependent build (either through snapshot or artefact dependency)

like image 63
Biswajit_86 Avatar answered Nov 15 '22 02:11

Biswajit_86


I am using this myself and I can access my dependent Build's Checkout directory with...

%dep.<dependecyID>.teamcity.build.default.checkoutDir%

I believe this will only work with a Snapshot Dependency though

like image 40
jonhoare Avatar answered Nov 15 '22 02:11

jonhoare