Thanks Jamis! It worked great!

On Jun 6, 2008, at 11:49 AM, Jamis Buck wrote:

>
> The problem is this line in your deploy.rb:
>
>  set :mongrel_conf, "#{release_path}/config/mongrel_cluster.yml"
>
> That gets executed before your selected stage (systest) gets loaded,  
> so
> at that point, capistrano knows nothing about your custom :deploy_to
> path. This causes :release_path to be evaluated (and cached) with the
> default, which is "/u/apps".
>
> What you want to do is specify :mongrel_conf via a block, so it  
> won't be
> evaluated until it is actually needed, e.g.:
>
>  set(:mongrel_conf) { "#{release_path}/config/mongrel_cluster.yml" }
>
> That'll give capistrano a chance to load your stage, and your custom
> :deploy_to definition, before the release_path and others are  
> evaluated.
>
> - Jamis
>
> Sam Granieri, Jr wrote:
>> I'm trying to deploy multiple versions to the same server using
>> multistage , and i'm running into problems with the cap update code
>> command.
>>
>> Here's my deploy.rb
>>
>>   set :stages, %w(systest acceptance production )
>>   set :default_stage, 'systest'
>>
>>   require 'lib/captasks'
>>   require 'capistrano/ext/multistage'
>>
>>   set :application, "pabf"
>>   set :user, "deploy"
>>   # set the sudo runner user to whatever the connecting user is
>>   set :runner, user
>>
>>   #subversion repository section
>>   set :scm, :subversion
>>   set :repository,  "xxxxxxxxxxxxxxxxx"
>>   set :scm_username, xxxxx
>>   set :scm_password, xxxxxxx
>>
>>   set :mongrel_conf, "#{release_path}/config/mongrel_cluster.yml"
>>   set :mongrel_servers, 6
>>   set :rails_env, 'production'
>>   ssh_options[:compression] = true
>>
>> I also created a file called config/systest.rb
>>
>>   set :deploy_via, :remote_cache
>>   role :app, "10.136.11.86"
>>   role :web, "10.136.11.86"
>>   set :stage, :systest
>>   set :deploy_to, "/var/www/#{application}/#{stage}"
>>   set :mongrel_port, 8000
>>
>> When I type cap deploy, it defaults to the systest environment, and  
>> it
>> fails on update code. here's the output
>>
>>   * executing `deploy:update_code'
>>     updating the cached checkout on all servers
>>   * executing "if [ -d /var/www/pabf/systest/shared/cached-copy ];
>> then svn update -q --username xxxxxxx --password xxxxxxx --no-auth-
>> cache  -r1804 /var/www/pabf/systest/shared/cached-copy; else svn
>> checkout -q --username xxxxxx --password xxxxxx --no-auth-cache  -
>> r1804 https://xxxxxxxxxxxxx/pabf/trunk /var/www/pabf/systest/shared/
>> cached-copy; fi"
>>     servers: ["10.136.11.86"]
>>     [10.136.11.86] executing command
>>     command finished
>>     copying the cached version to /u/apps/pabf/releases/ 
>> 20080606163612
>>   * executing "cp -RPp /var/www/pabf/systest/shared/cached-copy /u/
>> apps/pabf/releases/20080606163612 && (echo 1804 > /u/apps/pabf/
>> releases/20080606163612/REVISION)"
>>     servers: ["10.136.11.86"]
>>     [10.136.11.86] executing command
>> *** [err :: 10.136.11.86] cp: cannot create directory `/u/apps/pabf/
>> releases/20080606163612': No such file or directory
>>     command finished
>> *** [deploy:update_code] rolling back
>>   * executing "rm -rf /u/apps/pabf/releases/20080606163612; true"
>>     servers: ["10.136.11.86"]
>>     [10.136.11.86] executing command
>>     command finished
>> command "cp -RPp /var/www/pabf/systest/shared/cached-copy /u/apps/ 
>> pabf/
>> releases/20080606163612 && (echo 1804 > /u/apps/pabf/releases/
>> 20080606163612/REVISION)" failed on 10.136.11.86
>>
>>
>> My problem is I never specified I want anything in /u/apps/. I want
>> code to be copied from /var/www/pabf/systest/shared/cached_copy to /
>> var/www/pabf/systest/releases/
>>
>> What can I do to override it?
>>
>> Sam Granieri
>>
>>
>>>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
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