Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Version control (e.g. in TFS) build configuration for TeamCity - is it possible?

I'm looking to migrate our build infrastructure from CC.NET to TeamCity. Admittedly pretty green with TeamCity at this point.

One potential show-stopper is that we need our build configuration to be version-controlled alongside the source code it builds. CC.NET makes this pretty easy and is a very useful/powerful feature.

From my investigation you can change where TeamCity stores its config/data, but none of the official documentation (nor other topics here on SO) seem to reference placing it in a version-controlled location such as TFS, Perforce or ClearCase.

I therefore wonder if it's possible and/or is it the 'done thing'??

Could it be that if TeamCity assumes R/W access to any config files and the underlying VCS makes files R/O requiring check-in/check-out semantics that this'll confuse TeamCity and stop it working.

Does anyone here have experience of version controlling TeamCity build configuration in Team Foundation Server (or similar)?

Thanks, Jack

FYI - How does one version control the configuration of a TeamCity project? seems to be the only similar thread here on SO. http://confluence.jetbrains.net/display/TCD7/How+To... and related official docs talk about migrating config and/or backing it up, which is close but not really the same thing.

like image 382
JHoxley Avatar asked Sep 11 '12 16:09

JHoxley


People also ask

Is TeamCity a version control?

TeamCity allows synchronizing project settings with the version control repository (VCS). Supported VCSs are Git, Mercurial, Perforce, Subversion, and Azure DevOps Server (formerly TFS).

What is build configuration in TeamCity?

Last modified: 15 November 2022. This section contains articles on how to create and configure build configurations via the TeamCity UI. A build configuration is a collection of settings used to start a build and group the sequence of the builds in the UI.

What is build configuration ID in TeamCity?

An ID is an identifier given to TeamCity entities (projects, build configurations, templates, VCS roots, and so on). Each entity has two identifiers: external ID. Universally Unique ID, or UUID.

What is the latest version of TeamCity?

In TeamCity 2022.10, you can use new REST API requests to check the status of your nodes in the high availability setup and reassign node responsibilities.


2 Answers

This isn't an answer, but...

We asked JetBrains for their recommendation on this and got the following response:

So far there is no functionality to store configuration settings in the version control. The settings are stored in XML on the disk (in TeamCity data directory - http://confluence.jetbrains.net/display/TCD7/TeamCity+Data+Directory) and in theory it is possible to synchronize the directory with a version control. You might want to vote for the feature or watch it in our issue tracker: http://youtrack.jetbrains.com/issue/TW-2806

I can't see any elegant solution, so would think that the best solution (least worst solution...) is to:

  1. Move complex build logic into MSBuild/Nant scripts that are version controlled; and
  2. If you have the time, implement a custom synchronisation service between your source control and the TeamCity data directory. In this case you will probably have to be prepared to deal with failures that will require manual merges from time to time (not fun :-( ).

Good luck, and if you find a good solution please share it :-D

like image 82
Sean Avatar answered Oct 14 '22 02:10

Sean


This has been introduced in TeamCity 9:

https://confluence.jetbrains.com/display/TCD9/Storing+Project+Settings+in+Version+Control

like image 44
Japster24 Avatar answered Oct 14 '22 04:10

Japster24