Yup, it's this line:

  set :mongrel_conf, "#{current_path}/config/mongrel_cluster.yml"

By referencing current_path in the value for that variable, you are
forcing Capistrano to evaluate the current_path, based on what it
knows about the deploy_to variable. Capistrano will then cache the
value of current_path, so even if you change deploy_to later, it won't
reset automatically.

What you really want is to use a lazily evaluated value for mongrel_conf:

  set(:mongrel_conf) { "#{current_path}/config/mongrel_cluster.yml" }

That way, mongrel_conf won't be evaluated until the first time it is
needed, which means current_path won't be evaluated until that time
either.

- Jamis

On 8/7/07, Jon <[EMAIL PROTECTED]> wrote:
>
> I have a complex deploy.rb file, because we actually have three
> slightly different setups that we deploy our rails app to; a build-
> server that gets the newest version on it every night for the people
> who don't want to run a local rails setup, a public site which tracks
> a branch, not trunk, and a local mirror of the public site.
> Previously, we maintained three separate deploy.rb files and symlinked
> the proper one at deploy time, but with Cap2 I'd hoped to simplify
> things. Unfortunately, it's not working right.
>
> I run cap build deploy, and get this in the output: (most of the
> output trimmed for brevity)
> #   * executing `deploy:symlink'
> #   * executing "rm -f /u/apps/nexus/current && ln -s /u/apps/
> nexus_build/releases/20070806204814 /u/apps/nexus/current"
> #   * executing `deploy:restart'
> #   * executing "sudo /u/apps/nexus/current/script/process/reaper"
>
> I hope you might have some suggestions?
>
> Here's our deploy.rb file:
>
> require 'mongrel_cluster/recipes'
> set :application, "nexus"
> set :repository, "http://dellsrv.champ.net:8082/svn_repository/
> projects/Nexus/branches/iteration-4/"
> set :deploy_via, :export
> set :user, "deploy"
> set :mongrel_conf, "#{current_path}/config/mongrel_cluster.yml"
>
> role :web, "buildnexus.champ.net" # note, this is a server on our
> internal lan; while champ.net is a registered domain name, our
> champ.net is entirely different.
> role :app, "buildnexus.champ.net"
> role :db, "buildnexus.champ.net"
>
> task :build do
>   set :application, "nexus_build"
>   set :deploy_to, "/u/apps/#{application}"
>   set :repository, "http://dellsrv.champ.net:8082/svn_repository/
> projects/Nexus/trunk/"
>   set :mongrel_conf, "#{current_path}/config/
> mongrel_build_cluster.yml"
> end
>
> task :mirror do
> end
>
> task :public do
>   role :web, "cheesedanish.nightingalenotes.com"
>   role :app, "cheesedanish.nightingalenotes.com"
>   role :db, "cheesedanish.nightingalenotes.com"
>   set :deploy_via, :copy
>   set :copy_strategy, :export
> end
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to