Up until now we’ve been happy enough to manage the build process manually from Github, but after a large rewrite of some sections (more to follow on that in another post) we’ve reached a point where we needed to put something more maintainable in place. Seeing as I’ve been through this a few times before at companies like Channel4, Disney and most recently at the BBC, I decided to stick to a set up that I know works well really for Java development.
First of all I started moving the sub-projects over to Maven, it may not be the most popular build system right now, but nothing comes close to Maven for Java development right now. Once the project hierarchies were in place I had to put a private repository in place so we could share libraries and plugins. I spent a few hours looking at repository managers at this point, but we’ve decided to go without one for now. I know from experience that this will become an issue later when we want to install additional libraries that don’t exist in public repositories, think javax-*, but with a small team of developers we can afford to skip it for now.
I thought about setting up the deployments to use Webdav, I’d used that at one of my old client’s sites and it worked pretty well, but seeing as we already have an SSH key setup in place, including extensive use of ~/.ssh/config files, using SSH & SCP was quicker and easier. One little trick I picked up this time around was to change the addresses for deployments from scp://… to scpexe:// so the system scp application is used rather than the Maven wagon so our URLs can use our SSH aliases.
Next up, we needed a CI server so don’t have to run the live builds from our laptops anymore! I’ve tried quite a few CI servers over the years, but I think Hudson has stabilised a lot over the last couple of years so I’ve decided to drop it in here too. I have a few issues with Hudson’s UI, I’ve seen installations with 300+ jobs and it becomes difficult to find anything without a grouping scheme (I don’t think views cut it), and it takes too long to navigate to some features, but on the whole it is a great little tool.
The two main differences between the build system we have now and the ones I’ve used before are;
- Authentication, some have used VPN and left the services open internally whilst others have made extensive use of x509 certificates, here I’ve set up SSH keys to authenticate developers.
- We’re using Git for SCM so you need to figure out your repository layout up-front. I’ll probably write another post about our choice of Git over the incumbent open source SCM, but the combination of Git and Github has worked really well for us and fits into our SSH key setup nicely.
All in, it only took a few hours to get everything up and running. I wasted part of that looking at repository managers before realising that we just don’t need one yet. The rest is all standard issue, but it does impress me how Maven and Hudson have grown up since I used them first, Maven especially, it was a terrible toddler but it has really grown up over the last year.
Tags: CI, continuous integration, Maven