Friday, September 05, 2008

TeamCity - Continuous Integration Server and Build Management Tool

TeamCity is a continuous integration & build management solution for both .NET and Java development. TeamCity is developed by JetBrains - the producer of the famous Resharper - and shipped in two editions: Professional Edition and Enterprise Edition. The Professional Edition of the team city is free and you can use it without a need for any kind of licenses. This edition is more than enough for small and medium size company or teams.

Build Servers are very useful tool in any development environment where you need to track the build state of your team code. It make sure that all the committed code is not in a breaking state. The integration with the build servers and the continuous integration tools like SVN and sourcesafe help you to assign the responsibilities of the breaking code to specific developer to fix.

TeamCity is a a very powerful build server which has many features to facilitate your project building process. You can download the last version of TeamCity from here. I have downloaded the last version and played a little bit with it and it seems very interesting tool. When you run it for the first time, you will be asked to make a new account. Then you will have to create a new project by entering the main project information. Afterwords, you will be asked to enter the general settings of the project. Then, you will have to enter a new build configuration. You can have more than one build configuration in the same project allowing a kind of switching for the build needs and requirements for your project.

In "Build Configuration" step, you need to define the build numbers format. You can have your own format for the builds numbers like "CG-01" or "MX-01" or whatever suitable format. You can define the criteria of the build failing. For example, you can define the failing criteria if the building execution itself failed, the project test failed, error reported by the build runner and/or the build take more than a specified number of minutes (timeout).

Also in this page there is a nice feature called "Status Widget". This means you can include the status of your build in any external web page or whatever external tracking site you may use internally. When you enable it, you will have to copy and paste small HTML and CSS tags inside this external page to show your build status.

Then you will be asked to enter the build runner information in "Build Runner" step. In this step, you need to define the platform you will use to build the project. Team City provide several build runners for .NET and Java projects as well. I am working with .NET so I choose MSBuild as a build runner. Then I specified the build file virtual path which is the solution file of my project (ex. teamcitytest.sln). When you select MS Build, you define the suitable .NET Framework version for the build. You also define more command line parameters for MSBuild.exe if required.

Then, you will enter the version control settings like the checkout path if it's different than the default directory of the agent. You can also make automatic labeling if the build succeeded.

There is another nice setting in TeamCity which allow you to run the build periodically. You set it by clicking "Edit Configuration Settings" in the top panel of the build progress screen. Then in the left tabs, choose "Build Triggering". Select "Other Triggering". Check "Automatically start a new build when the previous build failed." and specify the time intervals between the builds.

This was a very quick walkthrough for TeamCity. I really like it and recommend it for your development team as a very efficient and customizable build server.