Installing Jenkins-CI in SmartOS
21 August, 2013
Posted by on
I found a very helpful gist with a script and SMF service manifest for installing Jenkins CI on SmartOS. A few tweaks later, I have my own set up. Here’s my gist:
Now I have rvm, ruby 2.0 and the rbczmq gem all building and running tests and emailing me if any fail. I’m polling git for changes hourly from the projects github repositories.
Jenkins has a plethora of plugins available and integrates with git nicely. The only thing I found unobvious was that build scripts run from Jenkins don’t inherit a normal shell environment, so you may need to set up environment variables such as TERM, PATH and CA_BUN for curl.
Here’s my build script for rvm, which installs it locally and verifies it installed.
echo "Destroying any current installation of RVM in /home/admin/.rvm ..."
rm -rf $rvm_path
echo "running install script:"
if test -x $rvm_path/scripts/rvm
echo "Failed to install rvm"
One nice thing I set up is dependent builds. I have “install rvm” => “install ruby 2.0” => “build & test rbczmq” as dependent builds, so if a dependency changes, I re-run the dependent projects to make sure there’s no negative downstream side effects. Might be overkill, but if it picks up a change, I’ll be glad to know about it.
Next, I’d like to have a nice “Build passes tests in SmartOS” badge that I could stick in the repositories read me pages just like travis-ci has.
Even better would be for Travis to run builds in SmartOS directly given their awesome integration with github!