Running `cap deploy:pending` displays the commits since your last deploy. I wanted it’s output to be a bit different primarily so I could send a message to the others on the team about what’s just been deployed.
Specifically, I wanted the output to look something like this:
12345
Deployment revision 49c45b7
I deployed the latest. It includes:
* Added avatar support (Duff)
* Cleaned up the project switcher (Alex)
To do that, I added the following capistrano recipe:
123456789101112131415161718
namespace:deploydonamespace:pendingdodesc<<-DESC Show the commits since the last deploy DESCtask:default,:except=>{:no_release=>true}dodeployed_already=current_revisionto_be_deployed=`git rev-parse --short "HEAD"`puts"\n\nDeployment revision #{to_be_deployed}"puts"I deployed the latest. It includes:"putssystem(%Q{git log --no-merges --pretty=format:"* %s %b (%cn)" #{deployed_already}.. | replace '<unknown>' ''})puts"\n\n\n"endendend
Then I added a hook in my deploy.rb to run this automatically whenever someone deploys: