I should point out that my previous advice was for Capistrano 2.0;
Cap 1.4.1 does not support the :host option to run().
You can discover all of the host names that are associated with a
particular task by doing this (also, cap2 only):
servers = find_servers_for_task(current_task)
That will give you an array of Capistrano::ServerDefinition objects,
each of which can be queried for the "host" attribute:
hosts = servers.map { |s| s.host }
Hope that helps,
Jamis
On Jun 5, 2007, at 1:35 PM, Mat Schaffer wrote:
>
> On Jun 5, 2007, at 3:28 PM, Jamis Buck wrote:
>> :sequential => true would be a nice option, and I'd certainly
>> consider a patch for that. In the meantime, it would require some bit
>> of hackery to make it happen. Essentially, capistrano executes each
>> command on all matching servers in parallel. To do it in sequence,
>> you would need to invoke 'run' with each host in sequence:
>>
>> run "command", :host => "first"
>> run "command", :host => "second"
>> run "command", :host => "third"
>> # ...
>>
>> - Jamis
>
> Well I might just look into a patch. Your solution brings me to a
> problem I was pondering earlier, namely:
>
> What's the proper way to get the host's name when in a task?
>
> I looked at using execute_on_servers, but was derailed by the 'put'
> method which served my purposes. Although I wish I didn't have to do
> File.read() on that one....
>
> Thanks for the help, Jamis.
> -Mat
>
> >
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---