Snap-ci

For those of you who aren't aware of Snap-CI, it's a cloud based continuous integration service developed by ThoughtWorks. It's relatively new and I thought I'd have a look at it for running tests and deploying to Heroku.

Snap recently announced that they had full java integration, what better way to test this than trying to get it to run some Clojure :P
Getting my first project setup took minutes since I already had a repository in mind to use. Snap did some magic at first to try and detect the language it was in. Unsurprisingly it couldn't detect a standard Ruby or Java application. Not a problem it lets me create the pipeline anyway.

I created a single stage for the pipeline and got it to run a single line:

  lein midje

Clojure support isn't listed but I thought I would aim high and see if this worked.

Nope

Not a problem, I downloaded a the Leiningen self installing script (Snap claims that servers are CentOS boxes so this shouldn't be a problem). With the script saved in the project's root directory (as 'lein.sh') I changed the Snap configuration to run:

  ./lein.sh midje

and voila, we have a successful build:

$> ./lein.sh midje
which: no lein.sh in (/opt/local/ruby/1.9.3-p392/bin:/opt/rh/qt48/root/usr/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin)
which: no lein.sh in (/opt/local/ruby/1.9.3-p392/bin:/opt/rh/qt48/root/usr/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin)
Downloading Leiningen to /var/go/.lein/self-installs/leiningen-2.2.0-standalone.jar now...
...
All checks (6) succeeded.


Getting it deployed to Heroku from Snap was also a breeze. The project I was using already existed in Heroku, so it was as simple as adding my Heroku credentials and configuring snap to deploy to the correct application.

Comments