Redirect Output of Capistrano
Posted
by Eric Lubow
on Stack Overflow
See other posts from Stack Overflow
or by Eric Lubow
Published on 2010-04-09T23:38:38Z
Indexed on
2010/04/09
23:43 UTC
Read the original article
Hit count: 388
capistrano
|ruby
I have a Capistrano deploy file (Capfile) that is rather large, contains a few namespaces and generally has a lot of information already in it. My ultimate goal is, using the Tinder gem, paste the output of the entire deployment into Campfire. I have Tinder setup properly already.
I looked into using the Capistrano capture method, but that only works for the first host. Additionally that would be a lot of work to go through and add something like:
output << capture 'foocommand'
Specifically, I am looking to capture the output of any deployment from that file into a variable (in addition to putting it to STDOUT so I can see it), then pass that output in the variable into a function called notify_campfire
. Since the notify_campfire
function is getting called at the end of a task (every task regardless of the namespace), it should have the task name available to it and the output (which is stored in that output variable). Any thoughts on how to accomplish this would be greatly appreciated.
© Stack Overflow or respective owner