Here is the main meat of what I'm trying to accomplish. It is the old
multi-environment with a little twist from the fact I want the
deploy_to directory to be set differently for each of the servers that
I'm deploying to not just for what stage I have chosen. In the below
example if was running with the development stage I would want three
versions of the code sent out and deployed to "/var/www/domains/
development.example.org", "/var/www/domains/
control1development.example.org", "/var/www/domains/
control2development.example.org".
<deploy.rb>
set :stage, case ENV['stage']
when 'development':
role :app, 'development.example.org'
role :control, 'control1development.example.org',
'control2development.example.org'
role :db, 'development.example.org'
role :web, 'development.example.org'
'development.example.org'
when 'production':
role :app, 'example.org'
role :control, 'control1.example.org', 'control2.example.org'
role :db, 'example.org'
role :web, 'example.org'
'example.org'
else
role :app, 'staging.example.org'
role :control, 'control1staging.example.org',
'control2staging.example.org'
role :db, 'staging.example.org'
role :web, 'staging.example.org'
'staging.example.org'
end
# Lazy evaluation
set(:deploy_to) { ”/var/www/domains/#{stage}” }
# What I really want here is something like this but I'm not sure how
to accomplish it.
# set(:deploy_to) {"/var/www/domains/#{the_current_server_name}"}
</deploy.rb>
With the staging and development stages I am really deploying to the
same server so need to generate the deploy_to based on the current
server I'm trying to deploy to to separate out the configuration,
logging, ect... to properly simulate and keep the control/admin as
close to production as possible.
I suspect there is a way to grab the current server being deployed to
accomplish this dynamic deploy_to somewhere inside one of the deploy
blocks but I have been unable to google up any examples of doing this.
Thanks in advance for any help,
Mike D.
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---