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?
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.
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.
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.
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.
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)
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With