Capnotify and the future of Capistrano notifications

Note: this post was migrated from my old Tumblr-backed blog

For the last couple of weeks I’ve been working on a new framework to handle Capistrano notifications. Previously I’d created Capistrano plugins for grove.io and for mailgun and it was a great learning experience.

I started really thinking when we began using HipChat at the office. I discovered that the HipChat gem (here) had Capistrano support, but had a minor bug relating to how we used the branch variable. It turns out that anyone who writes a Capistrano notification gem is going to re-invent the wheel each time. Also, if one sends notifications through several channels, chances are that they want consistent language and behavior for these notifications.

Also, I really like the layout of my capistrano-mailgun gem’s emails and thought it would be great to not have code duplication if I decided to have a similar look and feel for another notification gem.

Enter Capnotify. Capnotify is a Capistrano plugin specifically for providing consistent behaviors and language for your notifications. Ideally, any notification gem would be built on top of Capnotify and anything that speaks Capnotify could modify those behaviors. It also provides a consistent interface for the user of the gems to modify that language across any extensions that they might load.

Capnotify is currently in pre-release on rubygems.org and I have a pre-release of the capistrano-grove gem as well, that’s using Capnotify.

Before I officially release it, I’m hoping to get some feedback to see what works for people and what doesn’t. Are the built-in messages and templates high enough quality? Is it extensible enough?

Capnotify was designed to not only be a platform for other gems to be built, but also function as a stand-alone entry-point into any existing notification system that someone might have. It provides a series of Capistrano triggers and default messages, for example, after a deployment is complete, you could have something like the following:

on(:deploy_complete) do
  MyNotificationGem.send_message( capnotify_deployment_complete_msg )
end

Documentation is about 80% complete for Capnotify and should be 100% complete for Capistrano Grove, so check them out:

See the associated READMEs for installation and usage instructions and feel free to submit issues or email me directly with questions.