public
Description: A Capistrano plugin to send e-mails on deployment
Homepage:
Clone URL: git://github.com/jellybob/deployment_notifier.git
jellybob (author)
Mon Oct 05 06:58:10 -0700 2009
commit  904054ec37c3f6f450ab06e8be5f730dacea704d
tree    a00f2c37a40b568718a22b91c0cb93f8a2f502c0
parent  6b8b12f37af9f1f9f19e0ec3cb2c3aac4823d8c1
name age message
file .document Mon Oct 05 03:21:36 -0700 2009 Initial commit to deployment_notifier. [jellybob]
file .gitignore Mon Oct 05 03:21:36 -0700 2009 Initial commit to deployment_notifier. [jellybob]
file LICENSE Mon Oct 05 03:21:36 -0700 2009 Initial commit to deployment_notifier. [jellybob]
file README.rdoc Mon Oct 05 06:58:10 -0700 2009 Update the README [jellybob]
file Rakefile Mon Oct 05 06:07:33 -0700 2009 Not hooked into Cap yet [jellybob]
file VERSION Mon Oct 05 06:34:51 -0700 2009 Version bump to 1.0.0 [jellybob]
file deployment_notifier.gemspec Mon Oct 05 06:37:50 -0700 2009 Regenerated gemspec for version 1.0.0 [jellybob]
directory lib/ Mon Oct 05 06:33:32 -0700 2009 Add support for reasons [jellybob]
directory spec/ Mon Oct 05 06:33:32 -0700 2009 Add support for reasons [jellybob]
README.rdoc

deployment_notifier

A plugin for Capistrano to send out notification e-mails on deployment.

I’m aware of cap_gun, but that attempts to send the e-mails locally, which is no good in an environment where we don’t have local SMTP servers.

Usage

Add the following to your Capfile:

  begin
    require 'blankpad/deployment_notifier'
  rescue LoadError
    puts "You need to install the deployment_notifier gem to deploy, so e-mail notifications will go out."
    puts "- gem install gemcutter"
    puts "- gem tumble"
    puts "- gem install deployment_notifier"
    exit 1
  end

  Blankpad::DeploymentNotifier.recipients = %w[recipient@example.org someone_else@example.org]
  Blankpad::DeploymentNotifier.from = "Deployment Notifications <deploy@example.org>"

  after :"deploy:restart", :"deploy:notify"

And that’s it. You can test it works by using:

  cap staging deploy:notify

If you’d like to add a message stating why you’re deploying to the top of the notification, then deploy like this:

  cap -s message="I just really like seeing those e-mails" staging deploy

Limitations

While it shouldn’t be too hard to extend this, it’s currently built to scratch the particular itch I was having.

  • Requires sendmail on the server you’re deploying to, at /usr/sbin/sendmail
  • Assumes you’re using capistrano/ext/multistage (because I always am)

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don’t break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

Copyright

Copyright © 2009 Jon Wood. See LICENSE for details.