Moving from Travis to Jenkins

I’ve been using Travis CI for quite a while for open source C++ projects. It is a great service: polished UI, well integrated with GitHub and other services and free for public repositories.

I’d rather spend my time adding new features than building infrastructure but it gets to a point where it just doesn’t cut it any more. Jenkins is an obvious alternate to Travis if you have a server to host it on — so empowered with a few free days I’ve built a Jenkins based CI build system for all my projects and it has been really worth the effort.

Jenkins is not a looker, but it is easy to install and configure — you’ll be running a simple build within minutes, it really is that easy. Unfortunately life isn’t simple, want to build on Ubuntu, Debian, CentOS, BSD, etc? I do, and this is where Jenkins steps up with the assistance of Docker.

Install Jenkins, add the Docker plugin and the Build Status plugin and you have a good chunk of the value Travis brings to an open source project. Now all you need are a bunch of Docker images to build from, this is likely where you’ll spend most of your time if you go down this route since image building can be time consuming, especially if you are targeting older Linux distributions.

So with a single KVM/QEMU Jenkins VM on a Debian host I’ve got the capability to build on Ubuntu 14 and 16, Debian 8, CentOS 6 and 7 and Fedora 25. Another smaller VM running FreeBSD 11 gives me a build for that platform too. All this runs fast, much quicker than Travis — but your mileage will vary here depending on your host.

If you need any inspiration you can find my Dockerfiles at https://github.com/RipcordSoftware/jenkins-docker and build scripts at https://github.com/RipcordSoftware/AvanceDB/tree/master/.jenkins.