How can I exclude a role from 'cap deploy'?

457 views
Skip to first unread message

chris johnson

unread,
Aug 19, 2008, 7:34:16 PM8/19/08
to Capistrano
Hi all.

I have a custom role (in my rails deploy.rb file) like such:
role :daemon, "a.daemons.host.com", "b.daemons.host.com"

Then I have this code:
namespace :deploy do
namespace :daemons do
[:stop, :start, :restart].each do |t|
desc "#{t.to_s.capitalize} daemons using monit"
task t, :roles => :daemon do
begin
sudo "/usr/local/bin/monit -c /etc/monit/monitrc -g daemons
#{t.to_s} all"
rescue
puts "WARNING: monit exception caught: #{$!}"
end
end
end
end
end


The problem I've encountered is that when I "cap deploy", those
servers in the :daemon role are included in the normal deployment
process and are being treated like the servers in the :app role. Is
this normal behavior? Need to dig a little deeper, but this strikes
me as odd.

Thanks,
Chris

Jamis Buck

unread,
Aug 19, 2008, 7:58:45 PM8/19/08
to capis...@googlegroups.com
To exclude servers from deploy, do:

role :daemon, "server1", "server2", ..., :no_release => true

- Jamis

> --~--~---------~--~----~------------~-------~--~----~
> To unsubscribe from this group, send email to capistrano-...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/capistrano
> -~----------~----~----~----~------~----~------~--~---
>

chris johnson

unread,
Aug 19, 2008, 8:36:13 PM8/19/08
to Capistrano
That should do it :-) I appreciate your support Jamis; the more I dig
into capistrano, the more I am leveraging its power. Many thanks for
this great contribution.
-Chris
>  smime.p7s
> 3KViewDownload

Jamie Orchard-Hays

unread,
Aug 20, 2008, 10:58:56 AM8/20/08
to capis...@googlegroups.com
Same here! Thanks a lot, Jamis.

Jamie

Reply all
Reply to author
Forward
0 new messages