Customizing Output...

526 views
Skip to first unread message

jondavidjohn

unread,
Mar 7, 2012, 2:41:59 PM3/7/12
to Capistrano
Is it possible to customize (or disable) the Capistrano output?

It seems way too robust in terms of the information it is trying to
communicate... Seems like it would be helpful to be able to have an
option to turn it off, and allow you to write your own on completion
of a task based on success/failure, etc...

I really only care about seeing the full command it is running maybe
the first few times I deploy, and then only if it fails.

jondavidjohn

unread,
Mar 8, 2012, 12:49:39 PM3/8/12
to Capistrano
figured out how to do this in case anyone else is interested...

alias cap='cap -q'

Then just echo out what you want with the given 'after' and 'before'

before 'deploy:task' do
print "Some Task........."
end

after 'deploy:task
put "Done"
end

etc...

jondavidjohn

unread,
Mar 9, 2012, 5:46:48 PM3/9/12
to Capistrano
Ok, This solution worked well, but is it possible to tell cap to run
quietly (-q) from the deploy.rb file???

Rafa García

unread,
Mar 12, 2012, 7:21:43 AM3/12/12
to capis...@googlegroups.com
Hi jon,

  I think you can do it adding this line(not tested):

default_run_options[:verbose] = 0

Tell me if it works, regards

2012/3/9 jondavidjohn <thirs...@gmail.com>
--
* You received this message because you are subscribed to the Google Groups "Capistrano" group.
* To post to this group, send email to capis...@googlegroups.com
* To unsubscribe from this group, send email to capistrano+...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano?hl=en

jondavidjohn

unread,
Mar 14, 2012, 11:18:58 AM3/14/12
to capis...@googlegroups.com
Good thought... after looking through the Capistrano source it looks like '[:verbose]' is the option that controls it from the shell option '-q'

But setting it with `default_run_options` is not working as I would also expect it to.

Thanks.
2012/3/9 jondavidjohn <thirs...@gmail.com>
* To unsubscribe from this group, send email to capistrano+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano?hl=en

Rafa García

unread,
Mar 14, 2012, 11:44:10 AM3/14/12
to capis...@googlegroups.com
I'll check it this night and I'll tell you something

Regards

2012/3/14 jondavidjohn <thirs...@gmail.com>
* To unsubscribe from this group, send email to capistrano+...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano?hl=en

Rafa García

unread,
Mar 14, 2012, 8:35:45 PM3/14/12
to capis...@googlegroups.com
I found it! In Configuration class logger has an accessor, then you can access to logger from your deploy.rb file directly.

Just add to your deploy.rb:

logger.level = 0

Or maybe you prefer(it's the same):

logger.level = Logger::IMPORTANT      # or Capistrano::Logger::IMPORTANT

You can find Logger class under Capistrano module, but you don't need to specify it because you're under Capistrano namespace. 

Good night

2012/3/14 jondavidjohn <thirs...@gmail.com>
* To unsubscribe from this group, send email to capistrano+...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano?hl=en

jondavidjohn

unread,
Mar 16, 2012, 11:49:17 AM3/16/12
to capis...@googlegroups.com
That did it, thank you so much!

I think I'm going to be blogging soon about my experience customizing the output and I'll post it here.

jondavidjohn

unread,
Apr 11, 2012, 11:01:17 AM4/11/12
to capis...@googlegroups.com
In case anyone cares, I outline my steps to customize deployment output here...

Chris Benes

unread,
Apr 11, 2012, 6:28:20 PM4/11/12
to Capistrano
John...

Thanks for sharing this. I'm going to incorporate it into my
scripts. It looks great!

Chris

On Apr 11, 11:01 am, jondavidjohn <thirsty...@gmail.com> wrote:
> In case anyone cares, I outline my steps to customize deployment output
> here...
>
> http://jondavidjohn.com/blog/2012/04/cleaning-up-capistrano-deploymen...
Reply all
Reply to author
Forward
0 new messages