Hm, I would swear up and down that I tried exactly that several times and
got odd error messages. Trying it now, however, still doesn't appear to do
what I need - setting the variable to "server1,server2" yields the
following output
triggering load callbacks
* 2013-08-17 17:22:59 executing `deploy:cleanup'
* executing "ls -xt /path/to/releases"
servers: ["server1"]
[server1] executing command
command finished in 512ms
*** no old releases to clean up
It doesn't try to remove old releases on server2.
On Thursday, August 15, 2013 8:37:31 PM UTC-7, dbray wrote:
>
> 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]<javascript:>>
> 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]<javascript:>
> * To unsubscribe from this group, send email to
> [email protected] <javascript:> 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] <javascript:>.
> 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.