For the short-attention spans (like mine):

brew install hudson

OK. That should work now. That may not work…yet. There are details after the jump for those who don’t want to wait for the pull request to go through. Oh, and read the directions after running that command to get it to launch automatically.

UPDATE: mikemcquaid was super fast and the changes are merged. Read the details below for more info both on what happens, the basic approach, and how you can brew install your own version.

For some reason I’ve had a thing for making Hudson easier to install. Several years ago I wrote the 3-minute setup guide which the fantastic maintainer Kohsuke Kawaguchi turned around and rolled directly into Hudson. I don’t think I’ve touched any other CI system since (for anything beyond a quick test drive). The configuration management group at my current workplace uses that very direct self-executing hudson version to run a couple dozen production build servers; I didn’t have anything to do with that decision, it was just simple.

So, nearly 4 years later, I’ve been looking around at how to automate iPhone builds. My Waterlogged app has been in the AppStore for almost a year, and has covered quite a bit of ground in feature growth in that time. It’s reasonably mature, while still fairly small as far as the code goes. I finally picked up a mid-2009 Mac mini with the intent of making it into a build server. I’ve found a number of ideas about how to automate iPhone app builds and over-the-air beta deployments, as well as how to add automatic testing to that build. The first thing obviously seemed to be to install Hudson on my Mac mini.

So, all the cool tool installation on Mac these days is done with Homebrew. But brew info hudson left me with nothing. So I rolled up my sleeves in the evening on this Christmas Day (with kids not quite in bed yet) and started to take a crack at it. I wanted Hudson installed in a default location; no thinking required. And I wanted it so that when the mini rebooted, Hudson came up automatically. That meant I needed a LaunchDaemon. After finding a few really bad ideas out there, I came across Jérôme Renard’s simple plist file. I combined that with the basics from the mongodb Homebrew Formula, and the conventions I saw in the results from the grails install, and cobbled together a first draft of the Hudson install.

It’s probably less-than-ideal, but I figured I’d ship the first version, request a pull, and then let the magic of git and crowds perfect it over time. I created the Formula on my Air, pushed to GitHub, then with a few commands on my mini,

I was ready to install my own Formula.

and it launches now, and is setup to launch any time my user logs in. I hit it in the browser, and it came back just fine.

Notice that if my pull request gets merged in soon, the first part just drops off and you get left with just 3 commands:

and the bottom two are given to you when you run the first one. So in the end, all you need is

brew install hudson

Which is where we started… Merry Christmas, and Happy Building on your Mac!

comments powered by Disqus