Ahh the problem lies not in cap but your definition
hosts=ENV['hosts'].split(',')
hosts.each do |instance|
role :web, *hosts
role :app, *hosts
role :db, *hosts
end
If your hosts is really semi colon delimited the host.each loop is unnecessary
the splat operator takes care of it.
hosts may also be a reserved name in capistrano
If hosts is not reserved, and you've really fed the environment variable a
comma delimited list then
hosts=ENV['hosts'].split(',').map(&:strip)
role :web, *hosts
role :app, *hosts
role :db, *hosts
(I would strip the results for safety.)
Should be enough, or switch it around to the server helper and don't even
bother with an intermediate variable.
ENV['hosts'].split(',').map(&:strip).each do |instance|
server instance, :web, :app, :db
end
On Aug 14, 2013, at 10:47 PM, "C. Benson Manica" <[email protected]> wrote
> Why does
>
> https://gist.github.com/cbmanica/62385
>
> only execute deploy:cleanup on one of the hosts specified? And why hasn't
> anyone on the entire internet documented how to accomplish such a seemingly
> universal task?
> --
> --
> * You received this message because you are subscribed to the Google Groups
> "Capistran 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
--
--
* 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
---
You received this message because you are subscribed to the Google Groups
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.