# Automatically send e-mail describing each cap deploy?

**URL:** <https://www.ruby-forum.com/t/automatically-send-e-mail-describing-each-cap-deploy/113146>\
**Category:** Rails\
**Created:** [August 28, 2007, 3:37am UTC](https://www.ruby-forum.com/t/automatically-send-e-mail-describing-each-cap-deploy/113146 "2007-08-28T03:37:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [August 28, 2007, 3:37am UTC](https://www.ruby-forum.com/t/automatically-send-e-mail-describing-each-cap-deploy/113146/1 "2007-08-28T03:37:49Z")

</div>

Railsters:

Here’s the command to get the revision log between a given revision and  
the  
state-of-the-art:

svn log [http://my](http://my)…repository/trunk --revision 42:head

Under our usual mix of Capistrano and SVN, how would one write a  
Capistrano  
task to…

- collect the last deployment’s revision number
- sample that log
- e-mail the log to a list of e-mail addresses?

I attempted this script, and immediately got mired in the kind of absurd  
details that other systems take for granted, but which Rails has taught  
me  
I’m doing something wrong. So I throw the question open…

(And, naturally, Googling for “send e-mail” is hopeless!😉

–  
Phlip  
[http://www.oreilly.com/catalog/9780596510657/](http://www.oreilly.com/catalog/9780596510657/)  
“Test Driven Ajax (on Rails)”  
assert\_xpath, assert\_javascript, & assert\_ajax

---

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [August 28, 2007, 4:12am UTC](https://www.ruby-forum.com/t/automatically-send-e-mail-describing-each-cap-deploy/113146/2 "2007-08-28T04:12:52Z")

</div>

> Railsters:
> 
> Here’s the command to get the revision log between a given revision and the  
> state-of-the-art:
> 
> svn log [http://my](http://my)…repository/trunk --revision 42:head
> 
> Under our usual mix of Capistrano and SVN, how would one write a Capistrano  
> task to…

Write a “before\_deploy” task which…

> - collect the last deployment’s revision number

Looks at #{deploy\_to}/revisions.log and takes the last file which looks  
like this:

2007-08-27 15:19:12 web 6604 20070827221715

The fourth record is the SVN revision.

> - sample that log

Apply the above to your svn command via “system” or IO.popen and capture  
the output.

> - e-mail the log to a list of e-mail addresses?

Send it using net/smtp.
