Continuous integration is fun. There is probably a million ready-to-use tools to do it, but they may be too expensive/complicated/crappy or you just spent last 10 years building engine in your garage and hate everyone not invented here (there). Either way, I’m with you.

CI toolkit we are about to make consists of 3 separate parts:

1. The Notifier

Somehow we need to know that there is a work to do. Most VCSes are pluggable, allowing custom hooks occur on certain events (for example commit/push). But personally I prefer scheduled checks instead (as post-commit hooks may be slow). So basically cron (or Windows Task Scheduler) is your friend here.

2. The Builder

You need an automated build system here. On Windows it’s quite easy, because Visual Studio’s solution files can be used directly ( YourProject.sln /rebuild Release). On Linux/OSX there are makefiles/autotools, but for me using bash+make is quite painful. After all, the thing that programmers do the best is programming — so I’ve just wrote simple scripts to find all sources and build them, using PHP as scripting language of choice. Also, using PHP for whole “build system” is more cross-platform — it’s usually easier to bundle PHP executables than force anyone to install Cygwin shell (however I can’t imagine using Windows without it).

After building process is complete just call some simple API (see #3). Informations you need to send (you can use CURL for this) include project ID, OS/build version, build status, build logs (especially when build failed) and any other information you find useful. If you have unit tests you can attach them to logs. It’s also uber-cool to have automated test process (i.e. run game and start playing replay/script), taking screenshots at certain moments. You can also upload zipped package of game bundle (nightly builds).

3. The Server

Server receives API calls from building scripts. Data can be stored in DB. You will also need few pages that user can see (list of projects, versions, last N builds, specific build log). No rocket science here — average housewife can do it with PHP & MySQL in no time. E-mail notifications about failed builds sum up the effort. If you use some project management tool you can send notifications there as well. For example lets you create/update a ticket with a plain old e-mail.

BTW: build process can be moved server-side if you are able and willing to do it. But it’s usually easier to find cheap PHP+MySQL hosting than fully-equipped server with SSH access and build tools (GCC + friends) installed (let alone running the game to take some screenshots).

I’ve been using such system for my small cross-platform experiments. I do most dev on Windows (where I have Visual Studio) but I want to keep Linux/OSX versions alive and kicking. Small open-source teams can (and should!) try it as well.