The LibertyJS website is hosted on RedHat’s OpenShift, which is essentially RedHat Heroku. Meaning, it’s really easy to define a language, push to a git remote, and voila! There’s your website. Plus, you know, free (ish).
While that’s certainly fantastic, getting pull requests, merging, but then having to do a repetitive process of “git fetch && git rebase origin/master && grunt build …” got old.
Enter: Travis CI!
Travis CI is a continuous integration tool that is kind of stupidly easy to use (well, almost, we’ll see). The ‘.org’ version is free for open source projects (like LibertyJS), while ‘.com‘ is for private repositories.
Travis CI + OpenShift
OpenShift has an ALMOST perfect guide to deploying on TravisCI, but here’s what I did, starring the key “AHA!” moment.
- OpenShift project was already created (the rhc gem walks you through that)
- I needed to make my membership in LibertyJS public, so that Travis could see the project when I logged in
- Turned ‘on’ Travis for the project from the profile page (https://travis-ci.org/profile/[your github name])
- Added a .travis.yml to the project, specify language and version
- Travis runs my tests, YAY!
- Ran ‘travis setup openshift’, which takes you through a convenient “what’s your username/password” walk through and drops in the deploy information
- Set up my “after_success” steps to do exactly what I was doing locally to deploy
- Flail violently when it doesn’t work
- ****Discover that when Openshift says “domain,” they don’t mean the domain where the app lives, they mean the domain, like the user namespace where that url comes from (in my case, project name is libertyjs, domain is pselle)****
And here’s the way I figured it out: I searched for provider: openshift on github (since I knew something was wrong with the deploy line from the failures in Travis) to see wth OpenShift meant by “domain.” I also learned a good number of folk didn’t encrypt their passwords … eep!
So painful, but definitely a worthy learning experience, if I did feel a little dumb for being unable to figure it out for a while.