Yup, that's the one. Try this instead:
set(:deploy_to) { "..." }
that way the deploy_to won't be evaluated until after the application
value is set.
- Jamis
On 7/24/07, Martin Stannard <[EMAIL PROTECTED]> wrote:
>
> Hi Jamis,
>
> Here it is - maybe the set :deploy_to, "/var/www/apps/#{application}" line?
>
> thanks,
>
> Martin
>
>
>
> set :stages, %w(staging production)
> set :default_stage, "staging"
> require 'capistrano/ext/multistage'
>
> set :runner, "root"
> #set :application, "literate"
> set :repository, "http://xxxxxx/svn/literacy/trunk"
>
> # If you aren't deploying to /u/apps/#{application} on the target
> # servers (which is the default), you can specify the actual location
> # via the :deploy_to variable:
> set :deploy_to, "/var/www/apps/#{application}"
> set :user, "martin"
>
> # If you aren't using Subversion to manage your source code, specify
> # your SCM below:
> # set :scm, :subversion
>
> role :app, "0.0.0.0"
> role :web, "0.0.0.0"
> role :db, "0.0.0.0", :primary => true
>
> ssh_options[:port] = 443
>
> set :svn_username, "name"
> set :svn_password, "pw"
>
> # copies the screenshots and chapter swfs to the current directory
> task :after_update_code do
> run "ln -nfs #{deploy_to}/shared/config/database.yml.production
> #{release_path}/config/database.yml"
> # copy our screenshots from the shared dir to the current dir
> run "cp -R #{deploy_to}/shared/public/screenshots/ #{release_path}/public/"
> %w{parts images/site}.each do |share|
> run "rm -rf #{release_path}/public/#{share}"
> run "mkdir -p #{shared_path}/public/#{share}"
> run "ln -nfs #{shared_path}/public/#{share}
> #{release_path}/public/#{share}"
> end
> end
>
> task :regenerate_screenshots do
> # generate the screenshots
> run "RAILS_ENV=production #{deploy_to}/current/script/runner
> #{deploy_to}/current/lib/screenshot_importer.rb"
> # remove the old screenshots
> run "rm -r #{deploy_to}/shared/public/screenshots/"
> # copy our screenshots current back to the shared
> run "cp -R #{deploy_to}/current/public/screenshots/
> #{deploy_to}/shared/public/"
> end
>
>
> On 25/07/07, Jamis Buck <[EMAIL PROTECTED]> wrote:
> >
> > Something in your primary deploy.rb is referencing application before
> > it is being set. Can you show more of your deploy.rb?
> >
> > - Jamis
> >
> > On 7/24/07, martin <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi,
> > >
> > > I'm having some trouble getting multistage deployments working:
> > >
> > > [11:43:39] [EMAIL PROTECTED] ../litsite/trunk/config]$ gem list |
> > > grep cap
> > > capistrano (2.0.0)
> > > capistrano-ext (1.2.0)
> > > [11:43:43] [EMAIL PROTECTED] ../litsite/trunk/config]$ head
> > > deploy.rb
> > > set :stages, %w(staging production)
> > > set :default_stage, "staging"
> > > require 'capistrano/ext/multistage'
> > >
> > > set :runner, "root"
> > > #set :application, "literate"
> > > ...snipped...
> > >
> > > [11:43:51] [EMAIL PROTECTED] ../litsite/trunk/config]$ cat deploy/
> > > staging.rb
> > > set :application, "literacy_staging"
> > > [11:44:18] [EMAIL PROTECTED] ../litsite/trunk/config]$ cap deploy
> > > Please specify the name of your application, set :application, 'foo'
> > > [11:44:27] [EMAIL PROTECTED] ../litsite/trunk/config]$ cap staging
> > > deploy
> > > Please specify the name of your application, set :application, 'foo'
> > > [11:44:41] [EMAIL PROTECTED] ../litsite/trunk/config]$
> > >
> > > Any ideas?
> > >
> > > thanks,
> > >
> > > Martin
> > >
> > >
> > > >
> > >
> >
> > >
> >
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---