My friend David and I recently started work on Portland Cafés. The idea was simple enough: we wanted to know which coffee shops were open and how far away they were.
I wouldn’t say the project was complete, but it was usable. Usable enough to go live. We decided that, in publishing our web app, we wanted to incorporate some sort of automated deployment process.
Roughly, this meant:
- We commit some changes on a feature or fix. These commits eventually end up in a “production” branch,
master in our case.
- Changed files are transmitted to our server.
- The server builds the project from the new files.
On the surface, these steps don’t seem very complicated. The most obvious hole occurs between steps 1 and 2: something needs to respond to the post-commit hooks and deal with it. Several services exist to fill this hole. We looked at:
CircleCI was our first choice: their virtual machine runs your tests, deploying only when everything passes. That sounds awesome. After browsing the documentation and hooking it up to the repo, Dave and I quickly realized it was overkill. I wrote exactly one unit test. I don’t think Dave’s written any Ruby tests.
So, we settled on Deploy. Eight hours after pulling our hair out, we were set up.
The initial setup was hell (I could write a whole article on lessons learned) but it will pay off. Automation is future time saved. Now, merely merging code results in deployment, which is easy and awesome.
If only we could stop Readme updates from firing off the whole thing.