Setting up a basic continuous integration server with TeamCity
What is TeamCity? It’s a software that you would use to do continuous integration. Continuous integration is very important and it should never be an option on a serious project (that’s is my opinion and I strongly believe in the values it provide).
If you have followed the Building A New Application Series, you may be wondering why I would want to do that after setting up a complete integration server with CruiseControl.NET. Well, I was skeptical when I first heard about all the fuss surrounding this JetBrains project. After all, CruiseControl.NET was doing everything I wanted and more.
So the reason I made the switch is because of the time it take to set it up : 20 minutes. Everything was fully functional in under 20 minutes. I absolutely got no error at all. I just got through all the step of the wizard and then : done. Unit testing, code coverage, build, reports, etc… And it’s absolutely free for small team.
The big downside for me was the lack of support out of the box for other unit testing framework (other than NUnit and MSTest). My project is using MbUnit so I will need to do some more research to integrate it in my build process. But it is possible if you want to invest time in doing so.
So let’s get started with this little tutorial :
1. Download TeamCity.
2. Start the installation.
Just follow all the steps. I encountered a slight problem due to something already on port 80, so I used the port 8080.
I left everything intact in this screen, but this is where you specify some default folder used bu the build agents. The tempDir and workDir will be used to store your application artifacts and even your source file before the compilation if you don’t give it one in the configuration (later).
That’s it, you have installed TeamCity. Now let’s add our project to it.
3. Open TeamCity !!!
Nothing too complicated here, just enter the username/password you want for the administrator account. The email will be used to sent important information the build server would want you to know..
What I like is that you will be taken by the hannd for the rest of the steps. Click on the Create Project link.
Name of the project and a description. It will be useful if several projects are on the same build server.
Now click the Create build configuration link. You can have multiple build configuration by project.
In the build configuration window, you can change the way the build number are generated and the default behavior when the build fail. You can also specify that you want to start with a clean project.
There, you can decide how you want the project to be retrieved from the source control repository and where to put him. You can also decide when to label your build. If you do not want a label on a failed build, you can do so. Next, click on Choose build runner.
TeamCity is not only for .NET project. Several build runner are included such as MSBuild, NAnt, sln2003, sln2005, sln2008, Ant, Maven2, etc… Because I am using MbUnit as a testing framework I have decided to stick with MSBuild. But if you are using NUnit or MSTest you may want to use sln2003, sln2005, sln2008 as they can run your unit tests and tell the coverage of your assemblies. You need to fill in the Solution File Path field with the name of your .sln, it’s relative to your project structure (if it’s in the root, enter only the name of your solution file. Fill the rest of the field if you are using NUnit or MSTest.
Last step! Go to the Version Control Settings tab and click Create and attach new VCS root. Give it a name and choose the version control system (VCS) you want to use. Fill in the required field.
Save, and you’re done!
This is the most basic setup you can have. Of course, there is a lot of other things to configure to your specific needs. You can even have integration inside Visual Studio or Eclipse. As I said before the only downside I found is the lack of support for MbUnit, but I will work something to bypass that.
I may do another post going more in depth if I have time. Or maybe a screencast, that would be a lot of fun. If you’re interested, just leave a comment and I will consider it.



















February 8, 2008 at 7:43 am
[...] Setting up a continuous integration server with teamcity How to set up a continuous integration server with TeamCity Submitted: 3 minutes ago Category: Technology Submitter: RssFeed Website: sebastienlachance.com Report this link: Click here to report Comments: 0 [...]
February 8, 2008 at 7:52 am
Hello Sébastien,
Thank you very much for providing so in-depth initial installation and configuration review and such a positive feedback on how easy it was!
I hope you won’t mind if we place the third paragraph of your review on TeamCity’s website?
The JetBrains TeamCity team
February 8, 2008 at 9:22 am
Hi,
I see no problem at all, take everything you want
.
Thank you very much!
Sebastien Lachance
February 22, 2008 at 4:38 pm
This site inspired us much
interesting information on that blog.
The topic really necessary.
June 6, 2008 at 5:53 pm
[...] Setting up a basic continuous integration server with TeamCity – Sebastian Lechance [...]
July 27, 2008 at 9:56 pm
realtytrac with realseekr realtytrac
August 15, 2008 at 9:10 pm
I’m curious how you managed to set up the code coverage at all, let alone in 20 minutes. Was it a Java project? Cause my understanding was that the Teamcity code coverage features are only available for Java as of v3.1. As for MSTest I still haven’t been able to get that set up after days of trying. Don’t get me wrong, I think TeamCity’s the bees knees, but there’ve been a number of issues that’ve marred my first run with it so far. One problem was that apparently it doesn’t support having VCS paths with spaces ala (for SourceSafe) $/Project One/Sub/Project. It also doesn’t seem to support NUNit 2.4.7 out of the box. They’ve got a fix for that on the support pages, but when I applied the recommended fix all my build agents disconnected, while the server itself seems to work fine but ultimately that’s useless since no build agents = no builds.
In any case, I’d appreciate some help if you will with setting up code coverage.
September 5, 2008 at 4:12 am
nutt hentai inuyasha nutt free hentai
October 29, 2008 at 8:46 pm
[...] 29, 2008 Some months ago, someone from Jetbrains asked me if they could use a comment I made on my TeamCity blog post (the one I demonstrate how to get TeamCity up and running) on their testimonials [...]
January 3, 2009 at 8:11 am
oKpTsc hi nice site thx http://peace.com
January 7, 2009 at 2:24 pm
car tesco motor insurance motor tesco insurance car
May 19, 2009 at 11:11 am
Lovely blog! Thanks for the useful information.
June 28, 2009 at 7:11 am
one week to save a marriage…
saving the relationship…