Build Server Setup

Konoko from Bungie’s Oni.

This last weekend, my build server (Konoko) decided to finally go rampant. Unfortunately, over the past couple years she became increasingly unstable, ultimately resulting in the undeniable fact that she could no longer perform her duties as a part-time build server. Subsequently, my only course of action was to outfit another one of my machines (Kyla) to fill in.

The following article is a set of notes I put together during the setup process. I don’t expect everyone will have the same needs as my home setup, but I’ve done my best to explain why I configured my build machine the way it is as well as emphasize and supply solutions for a few of issues I ran into along the way.

Basic Setup

At this point we’ll assume that you have a WinXP box (I prefer a fresh install, but that’s not strictly necessary). Before proceeding, you should also install any fundamentals to your development pipeline. In my case this includes:

  • Powershell
    • Set the appropriate execution policy following so you can run scripts:
      PS> Set-ExecutionPolicy RemoteSigned
  • Programmer’s Notepad
  • Visual Studio (and any service packs)
  • .NET Framework
  • DirectX SDK
    • Ensure that the DXSDK_DIR was added by the installer.
    • Add the following to the Project and Solutions | VC++ Directories:
      • Include Files: $(DXSDK_DIR)include
      • Library Files: $(DXSDK_DIR)lib\x86
  • Python
    • Add the path as an environment variable.

For your build server, it is a good idea to make a shortcut to Services on your desktop:
Target: %SystemRoot%/System32/services.msc /s

The image above summarizes the arrangement I have setup at home. To be honest though, I don’t even have a monitor hooked up to my build server; I just use Remote Desktop to handle anything needed on the build server itself.

It should be noted that I install the source control client and CruiseControl client (CCTray) on the server in addition to the server software. This is simply for convenience and a personal preference.

Source Control: Perforce

My build system at home uses Perforce. It’s easy to install, easy to use, and it’s free for up to 2 users and 5 client workspaces. If you have a different source control system you prefer, go install that and just skip this section.

Installing the Perforce Server

Go to:

The server is labeled “The Perforce Server (P4D)”. You should get the installer appropriate for your machine (x86 or x64). The downloaded executable is simply called perforce.exe.

Install the following features:

  • Server (P4D)
  • Command-Line Client (P4)

I’m not using the the Perforce Proxy (P4P).

Server Configuration:

  • Choose your port.

Client Configuration:

  • Server: %SERVERNAME%:%PORT%

The version I installed (Feb 2010) automatically added Perforce as a service. You can verify this by opening up Services and searching for Perforce. This is connected to the Perforce/Server/p4s.exe. This should be set to have a Startup Type of “Automatic” so that it is started each time you boot the machine.

Firewall Notes

If you are using a firewall, you should add the p4s.exe as an “Exception” (Windows Firewall) or to the list of “Approved Programs” (ZoneAlarm). Otherwise, you most likely won’t be able to connect to Perforce via any remote machines (even though you will be able to run a P4 client on the build server locally). Also, it may be a good idea to add the p4d.exe in case you need to run it locally as a non-service.

Installing the Perforce Client

Go to:

The client is labeled “The Perforce Visual Client (P4V)”. The executable is called p4vinst.exe or p4vinst64.exe.

NOTE: if you are a die hard P4Win-type, you can find the legacy app here:

The client installation is pretty self-explanatory. I will note that I like to install the client on both the build server as well as my remote machines.

Internet Server: IIS

In order to use P4Web or CruiseControl.NET’s dashboard, we need to set up a web server application on the build machine. After having used both Apache and IIS in previous build system configurations, I’ve come to the conclusion that my simple Windows-based setup gets along just fine with IIS.

The installer for IIS is found on the WinXP CD. (IIS 6 on WinXP)

From the autorun:

  • Choose “Install optional Windows components”.
  • Check “Internet Information Services (IIS)”.
  • Click the Next button to install.

NOTE: if you happen to install this after you install CruiseControl.NET, you will need to pop open a command console and run the following registration app[1]:
Run: %WINDOWS%/Microsoft.NET/Framework/v2.0.50727/aspnet_regiis.exe -i

Firewall Notes

If you are using a firewall, you should add the %WINDOWS%/System32/inetsrv/inetinfo.exe (which is the executable for IIS) as an “Exception” (Windows Firewall) or to the list of “Approved Programs” (ZoneAlarm). Otherwise, you most likely won’t be able to connect to CruiseControl’s dashboard from a remote machine.

Build Integration: CruiseControl.NET

Go to:

Download the latest stable release of CruiseControl.NET. In my case this was the CC.NET 1.5 RC1 installer: CruiseControl.NET-1.5.6804.1-Setup.exe.

Go through the installer. One of the steps is called “Additional Conditions”, this includes:

  • Install CC.NET as a service.
    Make sure this is checked (unless you want to have to manually start and stop CruiseControl).
  • Create virtual directory in IIS for Web Dashboard.
    Make sure IIS is installed before installing CC.NET; otherwise this step won’t succeed.

Once CC.NET is installed, the service should have been automatically started. To check, open Services and find the CruiseControl.NET Server service. You can right click on it to Start or Stop it. While you’re here, right-click and go to Properties; check to make sure that it has a Startup Type of “Automatic” so that it is started each time you boot the machine.

Also, in the CruiseControl.NET Server service Properties, under the Log On tab, I had to set it to use an account with the appropriate environment variables set[1]. This caused me a lot of headache where my code would build on the build server while in the IDE, but it would fail to build when launched from the CC.NET Tray. The build would fail because it couldn’t find any of the DirectX includes, even though they had been set in the IDE (as described in the Basic Setup section above.)

Firewall Notes

If you are using a firewall, you should add the CruiseControl.NET/Server/ccnet.exe and CruiseControl.NET/Server/ccservice.exe as an “Exception” (Windows Firewall) or to the list of “Approved Programs” (ZoneAlarm).