Lee,

   Thanks, I'll give this a try later today.

   Essentially what I was hoping for was something along the lines of:
http://pastie.org/917637. Please bear in mind that I am just learning Ruby
so what I put there was likely closer to pseudocode than actual code.

   I wanted to be able to add that to my Capfile and then when I do a cap
deploy, it will work.  I don't know Capistrano to know if there is anything
I can hook into.

   Ultimately, what I have been doing is similar to what you suggested with
pipes.  It just seemed a bit kludgy and not really Rubyish.

   Is what I'm looking to do possible in the Capfile without hacking up the
Capistrano code?

-e

On Tue, Apr 13, 2010 at 3:52 AM, Lee Hambley <[email protected]> wrote:

> Hi,
>
> I recommend not messing with the Capistrano logger, Instead use what unix
> gives you and use pipes:
>
> $ cap deploy | my_logger.rb
>
> Where your logger reads STDIN and STDOUT and both records, and pipes it
> back to the appropriate stream.
>
> For an alternative, the Engineyard cap recipies [
> http://github.com/engineyard/eycap ]  have a logger [
> http://github.com/engineyard/eycap/blob/master/lib/eycap/lib/ey_logger.rb ]
> – this might be a useful reference if you do need to edit the code, but I
> recommend not doing.
>
> -- Lee Hambley
>
> Twitter: @leehambley | @capistranorb
>
>
>
> On 13 April 2010 05:15, Eric Lubow <[email protected]> wrote:
>
>> 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.
>>
>> It would be great if there was a patch that I could add to capture the
>> entire output (to $stdout or $stderr) and then at the end of the task
>> do this:
>>    room.speak "Deploying #{task} ..."
>>    room.paste "#{msg}\n"
>>    room.speak "Completed #{task}"
>>
>> Is this possible?
>>
>> (Full disclosure): I have already posted this question on
>> StackOverflow (http://stackoverflow.com/questions/2611628/redirect-
>> output-of-capistrano<http://stackoverflow.com/questions/2611628/redirect-output-of-capistrano>)
>> , but haven't yet received an answer.
>>
>> --
>> * You received this message because you are subscribed to the Google
>> Groups "Capistrano" group.
>> * To post to this group, send email to [email protected]
>> * To unsubscribe from this group, send email to
>> [email protected]<capistrano%[email protected]>For
>>  more options, visit this group at
>> http://groups.google.com/group/capistrano?hl=en
>>
>> To unsubscribe, reply using "remove me" as the subject.
>>
>
>  --
> * You received this message because you are subscribed to the Google Groups
> "Capistrano" group.
> * To post to this group, send email to [email protected]
> * To unsubscribe from this group, send email to
> [email protected]<capistrano%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/capistrano?hl=en
>

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to