Our latest post is from special guest and Engine Yard customer Matt Cowley. Matt is a freelance developer and the web manager at WMNF Community Radio. He can be found at http://www.madcowley.com. Matt originally published this post to his blog. Many thanks to Matt for pulling together the helpful info, and for allowing us to share it with you.
I've got a project hosted on Engine Yard's cloud servers, with geographically-dispersed team. The developers are often working on separate feature sets, often deployed independently. As a quality-control and awareness measure we wanted to be notified when a deploy was done.
This was pretty easy to set up, and would work with capistrano deployments also.
First we set up a mailer action; I used an existing mailer class for this but you might want to create a separate class just for process-type notifications:
and the corresponding deploy_notification.text.plain.erb:
I'll probably make that a little fancier with a direct link to the commit on the githubs, and possibly pull in the commit message etc.
Next, we add a rake task to call the mailer; I put this in /lib/tasks/deploy.rake:
Finally, for Engine Yard integration, in deploy/after_restart.rb:
That gets called by the engineyard chef scripts after the deploy finishes. For capistrano deployments, you could do the same in an "after deploy:restart" call.
That's it. Hope it's helpful.