Hello all,

I am currently trying to write a set of task commands that run based
on whether or not a particular server within the role attached to the
task is the primary server.

So for example, I have the following:

task :push_my_configs, :on_error => :continue do
    run "my command 1", :roles => :app, :only => { :primary => true }
    run "my command 2", :roles => :app, :except => { :primary =>
true }
end

This works perfectly if I have the following:

role :app, "mydomain1.com", :primary => true
role :app, "mydomain2.com"

it executes command 1 on mydomain1.com and command 2 on mydomain2.com
exactly as I intend.  However, if I have a situation where I only have
1 server, I get an error on one or the other command (depending on
whether or not I have the single server denoted as the primary).

'configs:push_my_configs' is only run for servers matching {}, but no
servers matched.

I'd be ok with the error if I could get it to proceed, but it won't.
It hits that and exits the deploy script.

How do I handle this situation?

Thanks in advance!

-- 
* 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