Setting up Jenkins
- Episode Source Code
- Jenkins Home Page
- Running Xcode Unit Tests from the Command Line
- Jenkins Build Status Notifier for OS X
Install with homebrew:
brew install jenkins
Then start the server. You can start it manually with:
java -jar /usr/local/Cellar/jenkins/1.459/lib/jenkins.war
Or set it up to start automatically with your system with:
mkdir -p ~/Library/LaunchAgents cp /usr/local/Cellar/jenkins/1.459/homebrew.mxcl.jenkins.plist ~/Library/LaunchAgents/ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
You'll also need the Git Plugin for SCM.
Configuring the build
Add your new job. For the build trigger, you'll use Poll SCM. This takes a crontab format string.
To make it poll every minute, you can use
* * * * *.
To run your build, it is easiest to put everything into a
build.sh script and simply invoke that from Jenkins. This also allows you to run the same build locally.
Running the Tests
There are detailed steps here, however the basic steps are:
- Create a new scheme based on your test target
- Edit the scheme and check "Run" under the build step for your test target
- Edit the test target settings and remove the
- Change the
Test After Buildsetting to
Got any other cool Jenkins tips? Let us know in the comments!