Tag Archives: continuous integration

Configuring Hudson/Jenkins to parse MSBuild output

When I started with continuous integration, I used CruiseControl.NET, but the XML configuration quickly got to be really tedious.

It didn’t take me long to switch to Hudson CI.  It’s free, and it’s easily managed through an intuitive web interface. Not that I can’t grok XML configuration files; I’d just rather be spending my time building things instead of figuring out how to get them built.

For a primer on how to use Hudson CI for .NET projects, take a look at Getting Started With CI Using Hudson For Your .NET Projects by Bob Cravens, or Continuous Integration with Hudson and .NET

The only problem is Hudson is Java-based, so it’s not exactly plug-n-play when it comes to .NET, MSBuild, and Visual Studio. Particularly, when a build failed, I would have to scan through hundreds of lines looking for the cause of the error, which is difficult to do with CTRL-F when this line is completely normal:

Compile complete -- 0 errors, 0 warnings
 

What is needed is the Log Parser Plugin (link includes formatting rules), which allows you to define regular expressions that determine how to interpret the lines of content in the MSBuild output, so that warnings and errors can be called out in different colors the same way that Visual Studio does. This plugin can be installed through Hudson’s built-in plugin manager, but you have to configure it yourself.

Read more »

Backing up Hudson, with Hudson

At work we use Hudson Continuous Integration for our build servers because, among other reasons:

  • It’s FREE!
  • It runs on Windows (for our C# builds) and on Mac/Linux (for our iOS/Android builds).
  • It has a web-based GUI that is MUCH easier to use than the XML-driven config used by CruiseControl.NET, which we used before switching to Hudson.
  • It has a rich system of plugins for adding functionality.
  • Did I mention it’s FREE?

The one nice thing about CruiseControl.NET was that because it had one complex XML configuration file, I would only edit that file in source control so that I could back out my changes if I screwed it up. Now I need a way to back up the Hudson configuration files so that if one of my build servers goes up in flames, I can get my team back in business quickly.

A good backup solution needs to be automatic and offsite, and due to the magic of distributed version control and the inherent job execution nature of Hudson, we can back up Hudson with Hudson. If this isn’t the ultimate in universe folding in on itself awesome, I don’t know what is.

Read more »

Automating IIS7 Setup with Microsoft.Web.Administration

Switching from Subversion to Mercurial with Kiln was one of the best things we ever did, but it wasn’t without its pain points. The biggest problem is when you have websites that can’t be hosted by the integrated Visual Studio web server (Cassini) and require complex IIS configurations that can’t be version-controlled.

With a distributed version control system (DVCS) such as Mercurial, you’re supposed to clone branch repositories all over the place, but redoing the IIS configuration can be a major drag.

Luckily, IIS7 comes with Microsoft.Web.Administration.dll, a managed assembly that allows you to automate server administration tasks, something that was next to impossible in IIS6.

Read more »