On Tuesday I gave a 10 minute nugget at NxtGenUG Cambridge on how to setup a project using JetBrain’s TeamCity. TeamCity is a continuous integration server, similar to CruiseControl.NET, however I find it much more useful, easy to use and more importantly easy to manage. In this post, I thought I would explain how easy it is to setup a new TeamCity project.
Installing TeamCity is an easy process, you simply download the installer from the site and click next a few times. This will install both the server and a build agent, TeamCity allows for multiple build agents on different machines to allow you to share the load of building and running tests.
Once it has been installed, visit the webpage (for me this was localhost:8080). You will need to accept the license agreement and create an admin account. You will then be shown with the homepage for the server. Click the nice big Create project link.
You will then need to enter a friendly name for your project.
Your project has now been created. The next stage is to add a build configuration, this will be how the project monitors source control and what is executes to build the project.
After clicking Create build configuration, you will be shown the first build configuration page. Give this a friendly name, you can then enter a build number which can be used in your build scripts and on TeamCity’s UI as I described in a previous post.
Next, you can enter some artifacts, these are the files which are saved and stored on the build server. These files could be your binaries or an installer. For example, to copy everything to a buildrelease directory the syntax would be:
“**/*.* => builds/Release/”
Next stage is setup the source control which TeamCity should monitor.
Click Create and Attach new VCS root. Given this a friendly name, and select the type for example Subversion. Enter the url of the SVN server, this is the directory which will be monitored. For example, it could be https://Newbie:8443/svn/TeamCityDemo/trunk
You VCS is now setup.
The next stage is to configure the build runner. This defines how to build the project. Below, I’m using MSBuild, which when it needs to build it will execute msbuild with the script srcbuild.msbuild.
That is now your project created. The final stage is to use build triggering by ticking the enable box. This is what will cause the project to be built when you commit an item.
Your now ready to go – everything is setup. The project and builds now appear on the main homepage.
Let the automated builds begin!