Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a variable to define a VCS root URL in Team City

We're trying to define a TeamCity project for a release tag. When we're ready to release, we tag trunk with a tag that includes the version number. We want the build process to checkout based on this tag and when the build is complete, move the files into a folder with a name that is also based on the version number.

We're only interested in having a "latest version" project, so each time we move to a new version, we will reconfigure the existing TC project with the new version number.

The problem I'm having is in parameterising the VCS root url (SVN). I know how to set up variables for the build that can be used in the build processes, which we could use to configure the folder we move the files to. However, I can't seem to find a way to create a variable that we can reference in the SVN url.

Is there a way to derive VCS urls from variables? Is it possible to have one variable shared between the VCS root and the project configuration?

like image 929
Niall Connaughton Avatar asked Feb 02 '10 18:02

Niall Connaughton


People also ask

What is configuration parameters in TeamCity?

Edit page. Last modified: 17 November 2022. Build parameters are name-value pairs, defined by a user or provided by TeamCity, which can be used in a build. They help flexibly share settings and pass them to build steps.


2 Answers

Starting from version 6.5, TeamCity allows to use parameters in VCS settings: Parameterized Version Control System roots

like image 141
mkuzmin Avatar answered Sep 20 '22 14:09

mkuzmin


I don't think Team City supports this, you can't use variables within the VCS settings as far as I have found when I tried. What I did to get around this was I have a parent template that defines a root VCS source, SVN in my case, each build configuration is built off this template then you can define checkout rules to the right of the VSC name you're using for a given build config on the 'Version Control Settings' tab and use variables there. So I can have all build configurations share the common SVN root and define specifics from there. You can make this variable a static fixed setting per build configuration by making it a configuration variable in the 'Properties and Environment Variables' screen or making it build run specific as a user parameter in the same screen but as a System or Environment variable. Hope this helps.

like image 25
jtruelove Avatar answered Sep 19 '22 14:09

jtruelove