7

We'd like to implement CI using TeamCity.

We use Git for source control and would like to make use of the "pre tested commits" or "personal builds" feature of TeamCity.

Does anyone have experience with the VS plugin for Teamcity?

As far as I've seen, it only supports Subversion, no word about Git.

Anyone used this setup with any success?

Ruben Bartelink
  • 59,778
  • 26
  • 187
  • 249
lysergic-acid
  • 19,570
  • 21
  • 109
  • 218

3 Answers3

11

As explained in Pre-tested “Commits” using Git by JoergM, you can emulate a solution similar to the TeamCity6.x "Personal builds on branches", by using personal repos:

JoergM's setup for personnal repo.

There is one central Git-repository that only contains pre-tested changes. I call this “Green Repository” because it should only contain changes that lead to green builds.
Every developer pulls from this repository but nobody is allowed to push to it.

Instead everybody has a personal repository (think fork if you were on GitHub). The CI Server watches those personal repositories. After a commit it starts the compile and test. If that was successful it pushes the changes to the Green Repository.

JoergM adds:

The question is whether we will continue using our own solution or switch to the new feature of Teamcity.
So far I can’t see any advantage of the Teamcity feature.
With our solution we are even more flexible in regard of branch design.

This kind of setup is similar to what I described in "What is the cleverest use of source repository that you have ever seen?".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 2 questions that arise from reading this: What happens in the auto-push fails? and how is this reflected directly into VS? unlike the plugin, this does not offer any VS or IDE integration. – lysergic-acid Aug 24 '11 at 12:49
  • @liortal: what I saw was generally, in case of failure, an email notifying the user, and the commits being discarded in the personal repo (for you to push them again after fixing the issue). But you are right, there is no direct integration with TC or or VS-addin (Visual Studio Addin: http://confluence.jetbrains.net/display/TCD65/Visual+Studio+Addin). – VonC Aug 24 '11 at 12:54
  • Maybe some simple plugin can be created as an extension for VS2010. How is the push discarded ? is this a feature of Git? – lysergic-acid Aug 24 '11 at 13:28
  • @liortal: "discarded" means simply that the branch is reset to what it had before the push. – VonC Aug 24 '11 at 13:33
  • but how does that occur? is it a Git specific feature? configured as some hook? the information about this is available in the blog post? – lysergic-acid Aug 24 '11 at 13:42
  • @liortal: simple hook which will trigger the build, and reset the branch + send the email if the build fail. The link with TeamCity can be through a job which will *pull* from the dev repo into the personnal dev repo (instead of the dev pushing to it): that way, for each new commit a dev makes, TeamCity would populate the personnal repo with said commits, try to build and accept or reject depending on the result of said build. That would be my way of setting up a basic integration between a Git solution and TC. – VonC Aug 24 '11 at 13:52
  • As a first step i would test to see how easy is this to really set up. Another point is both slower performance (2 x push, 1 x pull) instead of 1 x push operation. Also the space complexity is proportional to the number of developers pushing into the repository ( n * REPO_SIZE ) – lysergic-acid Aug 24 '11 at 13:55
  • @liortal: true. Although for *source files* repos, Git should keep the size of said repo pretty tight. – VonC Aug 24 '11 at 13:56
0

Note that support for Git branches has been considerably improved in TeamCity 7.1. In my opinion, this is far better than the personal build feature.

The relevant docs are available here: http://confluence.jetbrains.net/display/TCD7/Working+with+Feature+Branches

theDmi
  • 17,546
  • 6
  • 71
  • 138
0

TeamCity 6.5 has new feature: remote run on a branch. It works for Git and Mercurial and does not require IDE, see more here: http://confluence.jetbrains.net/display/TCD65/Branch+Remote+Run+Trigger

Pavel Sher
  • 2,201
  • 14
  • 14
  • what is a remote run and how it differs from the usual trigger upon check in? – lysergic-acid Aug 25 '11 at 01:42
  • In TeamCity there are two terms actually, "remote" run and "pre-tested commit". If your personal build started without commit option, it's a "remote run". Otherwise it's a "pre-tested commit". "Remote run on branch" feature was added in TeamCity 6.5. Now you can tell TeamCity server to watch for changes in Git/Mercurial branches whose names match some specified pattern. Once TeamCity detects a commit in such a branch it will trigger personal build on behalf of commit author. – Pavel Sher Jan 02 '12 at 13:47
  • Thanks. What uses are there for such a feature? i mean, it sounds very similar to the usual trigger upon check in (except that it listens on a different branch than the one specified on the VCS roots page). – lysergic-acid Jan 02 '12 at 16:26
  • Such trigger will start personal build. Usually, in TeamCity if you want to start a personal build you need IDE. But with this trigger, all you need is to push your personal branch on your Git/Mercurial server, and TeamCity will trigger personal build for you. – Pavel Sher Jan 03 '12 at 16:31