rhwood / jenkins-slave-osx

Jenkins JNLP slave service for modern OS X systems
MIT License
191 stars 58 forks source link

⚠️ I no longer use Jenkins, so am not maintaining this project. Please open an issue if you are interested in maintaining this project.

Jenkins Slave for OS X

Scripts to create and run a Jenkins slave via Java Web Start (JNLP) on OS X as a Launch Daemon.

Quick Start

bash <( curl -L https://raw.github.com/rhwood/jenkins-slave-osx/master/install.sh )

Features

OS X slaves created with this script:

Install

bash <( curl -L https://raw.github.com/rhwood/jenkins-slave-osx/master/install.sh ) [options]

The install script has the following options:

Update

Simply rerun the installer. It will reinstall the scripts, but use existing configuration settings.

Configuration

The file Library/Preferences/org.jenkins-ci.slave.jnlp.conf in /var/lib/jenkins (assuming an installation in the default location) can be used to configure this service with these options:

Adding Developer Certificates

Building application targets for iOS requires that your iPhone Developer certificates be available to the Jenkins slave.

  1. Export the Certificate and Key from Keychain for your developer profiles.
  2. sudo cp /path/to/exported-keys-and-certificates /var/lib/jenkins
  3. For each certificate and key: sudo -i -u jenkins /var/lib/jenkins/security.sh add-apple-certificate --certificate=/var/lib/jenkins/name-of-exported-cert
  4. Delete the exported certificate file if is not password protected.

Adding Server Certificates

If you decide to secure the Jenkins master, or need to add additional certificates for the slave to trust the Jenkins master, you only need (assuming your service account is "jenkins", and your CA is StartSSL.com) from a command line:

  1. sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.slave.jnlp.plist
  2. sudo -i -u jenkins
  3. curl -O http://www.startssl.com/certs/ca.crt
  4. ./security.sh add-java-certificate --authority --alias=root-ca --certificate=./ca.crt
  5. curl -O http://www.startssl.com/certs/sub.class1.server.ca.crt
  6. ./security.sh add-java-certificate --alias=ca-server --certificate=./sub.class1.server.ca.crt
  7. rm ./*ca.crt
  8. exit
  9. sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.slave.jnlp.plist