Chad,
Cap doesn't loop through the server, it runs the commands on all of them in
parallel, there are a couple of things (google Capistrano parallel helper)
you could try, most people can manage with $CAPISTRANO:HOST$ - you can use
it in a few places, regrettably inside a run() isn't one of them.

The easiest way is to rely on the server's own hostname, you could do
something like this:

run("#{sudo} ln -sf #{current_release}/`hostname`.conf
/etc/httpd/vhosts.conf")

... my example is a little contrived, but you can see how it might work!

-- Lee Hambley

Twitter: @leehambley
Blog: http://lee.hambley.name/
Working with Rails: http://is.gd/1s5W1


2009/8/10 Chad Arimura <[email protected]>

>
> Thanks Lee - this is perfect.  One more related question (this one
> should be easy...?):
>
> When I execute a cap command, the command reads the role and loops
> through each server in that role to execute the command.
>
> Inside that cap command, how do I retrieve the current server for
> which the command is currently executing on?
>
> Thanks again!
>
>
>
>
> On Aug 8, 2:43 pm, Lee Hambley <[email protected]> wrote:
> > Chad, it's in a couple of variables, take a look inside deploy.rb ($ gem
> > which capistrano) and open the lib directory, deploy.rb is in
> there.......
> > these are listed:
> > _cset(:revision)  { source.head }
> > _cset(:real_revision)     { source.local.query_revision(revision) { |cmd|
> > with_env("LC_ALL", "C") { run_locally(cmd) } } }
> > _cset(:current_revision)  { capture("cat #{current_path}/REVISION").chomp
> }
> > _cset(:latest_revision)   { capture("cat
> #{current_release}/REVISION").chomp}
> >
> > _cset(:previous_revision) { capture("cat
> > #{previous_release}/REVISION").chomp }
> >
> > Have a go with those, and see how you go, it looks to me asif the last
> three
> > are all the product of the REVISION file, but I'm assuming there's a
> reason
> > you can't use the data in there!
> >
> > -- Lee Hambley
> >
> > Twitter: @leehambley
> > Blog:http://lee.hambley.name/
> > Working with Rails:http://is.gd/1s5W1
> >
> > 2009/8/8 Chad Arimura <[email protected]>
> >
> >
> >
> >
> >
> > > Hi All,
> >
> > > Any ideas on how I can pull the commit # of the svn revision right
> > > after a deploy?
> >
> > > I want to build a YAML file after deploy so that the application can
> > > read it and display the build information (commit # and build date) to
> > > the users.
> >
> > > Thanks for any suggestions!
> >
> > > Chad
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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.co.uk/group/capistrano?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to