Interesting, I can't duplicate this. If I add the following task to my deploy.rb:

  task :show_stage do
    puts(stage)
  end

and then invoke this:

  cap production show_stage

it correctly prints "production" to my terminal.

Are you sure you've got the staging stuff configured right?

- Jamis

On Apr 19, 2008, at 6:34 PM, J2M wrote:

I have a multistage setup with a production.rb & testing.rb under
config/deploy and have set up the deploy.rb according to
http://weblog.jamisbuck.org/2007/7/23/capistrano-multistage but none
of my custom tasks within deploy.rb can reference the variable stage
e.g.

 namespace :nginx do
   desc 'Setup symlinks to the sites public directory an nginx
config.'
   task :setup, :roles => :app do
     sudo "rm -f #{public_html}"
     sudo "ln -fs #{current_path}/public #{public_html}"
     sudo "rm -f /etc/nginx/vhosts/#{application_stage}.conf"
     sudo "ln -fs #{current_path}/config/nginx.#{stage}.conf /etc/
nginx/vhosts/#{application}.#{stage}.conf"
   end
 end

I just get undefined local variable or method `stage' .....

How do I keep this dry and have all my custom tasks in deploy.rb
rather than having to put them into both  deploy/production.rb and
deploy/testing.rb?

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


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to