Setting up CI with TeamCity

Publish date: 09 Aug 2016
Tags: tools

I have used an Azure Virtual Machine (Win 2008 Server, standard DS1 1core-3.5GB memory) for this.

Download JetBrains TeamCity on the server. I planned to install both the server and the build agent on the one box. This will do for now. I will look at moving the build agent to another server if there is demand. Accepted the default settings during installation.

I wanted to connect to bitbucket to retrieve the latest source using SSH. I added a new user (called BuildUser) to Bitbucket and added an SSH public key (bit bucket has good documentation on creating SSH keys. I used my bash shell to create these for the BuildUser user). One gotcha was that the Username had to be ‘git’.

Bitbucket

I created the build steps:

  1. Installing nuget packages

  2. Build the VS2015 solution

TeamCity

To use the MSBuild, I had to download and install Build tools and install agents for Visual Studio 2015.

These [videos](https://www.youtube.com/watch?v=gQAuHWgSJ_o - build Zen Digital) by Zen Digital proved useful.