Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you make dependencies relative when using TeamCity Templates?

Tags:

teamcity

When I copy a Project which uses templates, all the dependencies in those templates appear to be "absolute". That is after copying,it appears the new projects build configurations dependencies will all point back to the original build configurations.

Is there a way to make this work so that the dependencies in the templates are "relative" to the project?

Thanks

like image 383
Jack Ukleja Avatar asked Sep 20 '11 10:09

Jack Ukleja


People also ask

How do I add a template to TeamCity?

You can create new build configurations based on a template. You can associate/attach any number of existing build configurations with/to a template: there is the Attach to template option available from the Actions button in the upper right corner of the screen.

What is snapshot dependency in TeamCity?

A snapshot dependency alters the builds' behavior in the following way: when a build is queued, so are the builds from all the build configurations it snapshot-depends on, transitively; TeamCity then determines the revisions to be used by the builds ("checking for changes" process).

What is artifact dependency?

The Artifact Dependency Graph (ADG) of an artifact is the recursive DAG (Directed Acyclic Graph) of all the input artifacts that are transformed by a build tool into that artifact. It includes the direct input artifacts, and the recursive set of artifacts to each input artifact, all the way down to source code.

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.


1 Answers

AFAIK it just can't be done at the moment. A search in the bug database of TeamCity leads to three bugs/requests:

TW-18304 Support project relative snapshot dependencies in a build configuration template (OPEN)

Which corresponds to your question, but is considered to be a duplicate of

TW-3287 Project templates (OPEN)

But a comment of TW-3287 also suggests the use of:

TW-4612 Project-level properties (FIXED)

So, you might be able to use project level properties to serve your needs. Depending on how the projects differ, you can base the build configurations in the different projects on common templates which in turn are parametrized with properties that you define on the project level. The templates should not contain dependencies, you will need to configure these in the 'original' project. According to a comment on TW-18304, a simple copy of the project should then actually keep the references within the newly copied project. Haven't tried any of this, but it might be worth a try.

like image 200
The Nail Avatar answered Sep 20 '22 07:09

The Nail