Using TeamCity for ASP.NET development: Installing on IIS

This is the first part of a blog post series on using TeamCity continuous integration server from JetBrains for asp.net development.

Here are the links to the parts of the series:

  1. Installing/Configuring TeamCity for use with IIS [this post]
  2. MSBuild requirements for web package publishing
  3. Deploying via Web Deploy
  4. Backup (pre-deploy)

Why TeamCity?

TeamCity from JetBrains is build/CI server that I was first introduced to about a year ago.
This is how JetBrains describes it:

imageTeamCity is a user-friendly continuous integration (CI) server for professional developers and build engineers, like ourselves. It is trivial to setup, manage and use. It scales perfectly for a company or a team of any size. TeamCity is absolutely free for small teams.

In addition to that I would like to add that it’s easy to customize the build process which I think differs it from Team Foundation Build for example.
The most important aspect however is that it supports more that just compiling code and running tests, it supports the entire life-cycle of deploying an application from committing a change to that change ending up in production (sometimes referred to as continues delivery).

TeamCity is however not a substitute for TFS, it’s an alternative for TFS Build just as GIT is an alternative for TFS Source Control.

1. Installing/Configuring TeamCity for use with IIS

For demo purposes I’m setting up a TeamCity server on own laptop with the help of a Windows 8 Hyper-V virtual machine (the same concepts will apply in a more production-like environment though).

What we want to accomplish is to be able to use an easy-to-remember address, http://teamcity.virjole.local, to reach our TeamCity server (the image below is meant to give an overview of the infrastructure).

image

1.1 In short

…this is what we want to accomplish:

  1. From my laptop a request to http://teamcity.virjole.local is issued –>
  2. The request is routed to server virjole-build01(5.5.5.13) –>
  3. IIS picks it up on port 80 –>
  4. Routes it to port 8080 –>
  5. Apache picks it up on port 8080 –>
  6. TeamCity server admin UI is shown

1.2 In detail

note: I’m not going to explain in depth on how to install and configure TeamCity, firstly because it’s pretty easy to understand anyway and secondly because there are so many great posts on the topic out there already (Howard van Rooijen has one great example that I’ve used).

Here’s just a quick summary of the steps that I’ve taken to set this up (read the post, “A Step by Step Guide to Hosting TeamCity in IIS”, to get a more in-depth view of it if you’re interested):

  1. created a virtual server that will act as our TeamCity server on my laptop using hyper-v (virjole-build01 with an internal IP of 5.5.5.13)
  2. added a hosts file entry (in lack of a proper DNS) to “link” teamcity.virjole.local to 5.5.5.13
    image
  3. installed IIS on the TeamCity server
  4. installed and configured TeamCity, which runs on Apache, to use port 8080
    image
  5. installed and configured Application Request Routing (ARR), using web platform installer
    image
    note: ARR uses Web Farm Framework which is not fully compatible with Web Deploy 3.0 (which I’ll use later on in this post). Since the farm only consist of one server the errors will not occur in my example.
  6. created a new  Web Farm Framework server farm via the IIS management UI and added the local server as the only server in the farm (127.0.0.1)
    image
    note: that I’ve configured ARR to route to 127.0.0.1 (localhost)on http port 8080…since my TeamCity server is configured on that port.
  7. edited the default inbound rule created by ARR which will take incoming requests with the host, teamcity.virjole.local, and send them to the server farm, TeamCity, where ARR will take over and route them to port 8080 where Apache/TeamCity will pick them up.
    image

1.3 In summary

This is what we have accomplished so far:

  1. From my laptop a request to http://teamcity.virjole.local is issued –>
  2. The request is routed to server virjole-build01 –>
  3. IIS picks it up on port 80 –>
  4. ARR routes it to port 8080 –>
  5. Apache picks it up –>
  6. TeamCity server admin UI is shown

image

Next let’s see what it takes to make TeamCity compile, package, and deploy an asp.net application…

, , , , ,

  1. Configuring TeamCity for ASP.NET development: Part 3 | Johan Leino
  2. Configuring TeamCity for ASP.NET development: Part 4 | Johan Leino
  3. Using TeamCity for ASP.NET development: MSBuild Requirements | Johan Leino
  4. Using TeamCity for ASP.NET development: Deploying | Johan Leino
  5. Using TeamCity for ASP.NET development: Backup | Johan Leino

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: