0

TeamCity via IIS on port 80, using a reverse proxy, Part 2 host filtering so you can access Teamcity and other sites in IIS at the same time

by Jon 30. October 2010 23:29

If you followed my previous post how to setup ARR Routing to set up a reverse Proxy top access TeamCity over IIS 7.5 it will work perfectly and you will be able to access TeamCity on a different port.  However…. if you create a website under IIS on the same server you wont be able to access it because the reverse proxy is forwarding every site to TeamCity!  This might work for you but its not ideal if you want to run other IIS sites on the same server, the following steps will take you through setting up a condition so only url you specify will take you to TeamCity.

  1. Open up the Server Farm you just Created, and double click on Routing Rules
  2. Click on Url Rewrite
  3. Select the first Inbound Route and Press Edit
  4. Press the Add.. Button in the conditions pane
  5. Type {HTTP_HOST} into the condition input
  6. Ender the domain you want to want to forward into the pattern, all other domains will be passed to IIS normally
  7. Press Ok
  8. Press Apply and your done

Click on Routing RulesClick on Url Rewrite

Edit the Existing RuleSpecify the Host you want to Filter By

Tags: , , ,

Continuous Integration | development | IIS | TeamCity.Net

0

TeamCity via IIS on port 80, using a reverse proxy in IIS7, 30 second job, Part 1

by Jon 23. October 2010 06:55

So you have your TeamCity system, but annoyingly if you already have IIS on the server your TeamCity probably won’t be accessible on standard web port.  Wouldn’t it be nice to be able to host or access TeamCity via IIS 7.5 via one firewall rule, and get access to TeamCity from any coffee shop or site with restricted internet in the world?  Its much easier than you think in IIS 7.5, a real 30 second job to get it working using Application Request Routing (which is normally used to load balance webfarms) to setup a reverse proxy.

1. Download and Install Application Request Routing for IISS (2.0), using the web platform installer

Web Platform Installer

2. Start Internet Information Services Manager (IIS Manager).  Left Click on the Server Name Node to bring up the server configuration in the right pan and double click on Application Request Routing in the IIS Section.

 Click On Application Requestion Routing 

3. A Server Farms Node will Appear in the left hand side treeview, right click on the node and select Create Server Farm.  Give your new server Farm/reverse proxy a name

Enter a Name for TeamCity Server Farm

4. Press Next, enter localhost or your TeamCity server name, press advanced and change the port to the port that your TeamCity currently runs under.

Expand Advanced Settings, and Enter the port that TeamCity is running under

5. Press Finish, and press yes when prompted if you want the rewrite rules written for you.

Allow IIS to automatically rewrite the URLs

6. Finally navigate to your TeamCity Installation using a port free url go to administration->Server Configuration and remove the port from the Server Url and your done.

7. If you want to run other websites on this IIS Server you will need to continue onto Part 2- setup filtering so only specific hosts are forwarded onto TeamCity.

Tags: , , ,

Continuous Integration | development | IIS | TeamCity.Net

0

Automatic CI Versioning using TeamCity and MSBuild

by Jon 4. October 2010 20:33

If you read my first post on getting started with TeamCity, and my follow up post on moving to MSBuild you will have a lovely CI system that builds your solution each you commit your changes.  Whilst this sounds fantastic, unfortunately of the assemblies that are built will all be versioned with the same version that is pulled from the AssemblyInfo.  Luckily it isn't a major change to get MSBuild to update your solution files with the version number stored in TeamCity every time a build occurs by tweaking your MsBuild File: (and installing MsBuild Community Tasks)

<?xml version="1.0" encoding="utf-8" ?> 
<Project  DefaultTargets="ReleaseBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>

    <Target Name="ReleaseBuild">

        <Message Text="Set the correct $(BUILD_NUMBER)" /> 
	<FileUpdate Files='AssemblyInfo.vb' 
	  Regex='Version\("\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"\)' 
	  ReplacementText='Version("$(BUILD_NUMBER)")' />

	<FileUpdate Files='AssemblyInfo.cs' 
	  Regex='Version\("\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"\)' 
	  ReplacementText='Version("$(BUILD_NUMBER)")' />

        <Message Text="Building"/> 
        <MSBuild Projects="ProjectName.sln" Targets="Rebuild" /> 

    </Target>
</Project>

 

Shared Solution Level Assembly InfoThis change uses the FileUpdate Task in MsBuild Community Tasks to be performed on the two specified files, AssemblyInfo.vb and AssemblyInfo.cs.  The Regex will search for the word Version, followed by a valid four digit string version, and replace it with the build version configured in team city.

I use a Solution wide AssemblyInfo file called SolutionAssemblyInfo.vb or SolutionAssemblyInfo.cs to standardise Assembly Information across the solution by using a single shared file.  You can Create this shared file in Visual Studio by Adding a New Item to the Solution Directly, and then after you have created it you link it into each project by clicking on Add existing in each project and pressing the Arrow on the 'Add' Button and selecting 'Add as Link' instead.  This Shared Solution wide file contains the assembly info that is shared across the assemblies, each project will contain the link to shared assembly info file, and the existing assembly info file in the My Project folder.

Tags: , ,

ddd | development | MSSQL Server | Versioning

0

Getting Started with Continuous Integration with TeamCity in under 5 minutes!

by Jon 31. August 2010 22:17

Continuous integration is a way of increasing your productivity by automating the repetitive tasks you perform each day and as a function will improve the quality of the code you check into your source control system. It will give you more free time to develop better code, and will help you constantly improve yourself. If you find yourself doing the same thing day after day as a developer you really start automating those steps.

The good thing is it is really easy to setup a Continuous Integration. Within 5 minutes you could have installed and configured a system that will automatically compiled your code on a server when you perform a check-in and have any problems automatically reported back to you! What are you waiting for:

Make sure you choose a free TCP Port
Make sure you choose a free TCP port

Confirm the url for the Team City Installation has the correct port
Confirm the url for the Team City Installation has the correct port

Start the Services, and start TeamCity
Start the Services, and start TeamCity

Team City Starts
Team City Start

Accept the licence
Accept the licence

Enter an administrators details
Enter an administrators details

Team City is Started, and is prompting you to create a project
Team City is Started

Enter a project name
Enter a project name

Create a Build Configuration Called Build
Create a Build Configuration Called Build

Enter your SVN Settings for the project
Enter your SVN Settings for the project

Test the SVN Connection
Test the SVN Connection

Choose VisualStudio (2005/2008 or 2010) as a Build Runner, and Enter the Solution you want to Build
Choose VisualStudio as a Build Runner, and Enter the Solution you want to Build

Confirm the solution Builds from the Projects Screen, and then edit the Build
Confirm the solution Builds from the Projects Screen, and then edit the Build

Set the build to be automatically triggered when you Commit changes to SVN
Set the build to be automatically triggered when you Commit changes to SVN

and that's it, your Continuous Integration Server is up and running. Every time you commit a code change to SVN your solution will be automatically compiled. The sky is the limit, you can move over to a MSBuild Build Runner, perform automated tests, Generate Documentation, Code Statistics, Build and Install Deployment Packages. I've only just started using CI/TeamCity in my day job but I plan to Blog about my experiences as I implement more features. So far I have moved the office Build over to msBuild, automated developer statistics and RSS feed, and automated deployment to our test server. So expect some Blog entries on this in the coming weeks...

Powered by BlogEngine.NET 2.0.0.36
Original Design by Laptop Geek, Adapted by onesoft, and finally some tiny tweaks by JonAlb