A Jenkins Node Daemon on OS X

1 minute read

Update: Use Jenkins Slave for OS X instead. It’s based on these gists and has the benefit of being maintained.

I have been using Jenkins for continuous integration (CI) with some Java-based projects, and recently setup Jenkins for CI for a OS X application. For the Java-based projects, running Jenkins on a Linode works well, but the Linode-based Jenkins instance cannot build iOS or OS X applications.

Its easy to setup Jenkins to support distributed builds with a OS X system as a slave, provided the master can initiate SSH communications to the slave. If, like me, your Jenkins master cannot initiate a connection with your slave (which is my desktop iMac), it is still trivial to configure the slave to use Java Web Start (JNLP).

I generally followed Holger Staudacher’s post on the subject. However, he was frustrated by his inability to configure his Mac to automatically start the JNLP connection.

The following script launches the Jenkins slave service via Java Web Start after downloading the slave.jar file (thereby ensuring that the slave.jar is always the current version):

Launchd (the OS X launch manager) can launch this file using the following property list:

I have a simple script that can install these files for use by the user jenkins:

It can be run by copying the following command into a Terminal window:

bash <(curl -L https://raw.github.com/gist/4136130/81ee34ac6dd01e4f81e9b69650041c64f2e09678/install.sh)