Several years ago, I was working on a death march rails project with a small team. I needed some support from capistrano to prevent us from making some bone-headed miskates, like having two people trying to deploy the app into production at the same time (fielding calls from anxious clients). Dunce-cap was born.
Dunce-cap is a plugin (I'll gemify it someday) that adds a few new capabilities to your capistrano deploy. Install it with:
./script/plugin install git://github.com/bokmann/dunce-cap.git
and you get three new features:
Feature #1: Deploy Lock
Automatically when deploying, a lock file will be created on the server. If someone else tries to deploy, they will see a message like "Locked for deploy on July 16th 2010 2:33pm by dbock". The lock will be removed when the deploy is successful. If the deploy fails, it remains locked (a good thing) so you can debug the problem.
If you want to lock without a deploy, just type:
cap deploy:lockand you will be prompted for a lock message.
Feature #2: Notification System
Say you in a heated, panicked release and want to set a reminder to yourself (or the next deployer) "Don't forget to manually restart memcached to clear the old partials - don't have time to think that through right now". you can do that with:
cap deploy:notification:addand you will be prompted for the message to add. It will be stamped with the date, time, and notifier, and will be displayed at the next deploy.
Key points of the deploy process are notified via growl. If you are comfortable with capistrano, you can modify these tasks to send emails, post to twitter, and so on. If you do and send me a pullup request, it'll probably make it in.
Feature #3: Capistrano logging
All the nice output capistrano does to the screen is lost if you lose that screen buffer. If something goes wrong, that is valuable forensic evidence. Want to capture it to a log file? Now you can. At the top of your deploy.rb file, just include:
and someplace, name the log file with:
and yes, if you are using something like multi-stage, you can have log files per stage with something like: