Hi Fountain,
The photo directory can be reflected in all the future Capistrano releases by placing the photo folder in the ~/apps/<application>/shared directory. You can create a sym link from the ~/apps/<application>/shared/photo to ~/apps/<application>/current/public/photo. The following updated Capfile will help you to create the sym link from the shared folder.
====
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
load 'config/deploy'
namespace :deploy do
task :start, :roles => :app do
run "rm -rf /home/#{user}/public_html;ln -s #{current_path}/public /home/#{user}/public_html"
run "cd #{current_path} && mongrel_rails start -e production -p #{mongrel_port} -d"
ln -s #{deploy_to}/shared/photos #{current_path}/public/photos
end
task :restart, :roles => :app do
ln -s #{deploy_to}/shared/photos #{current_path}/public/photos
run "cd #{current_path} && mongrel_rails restart"
run "cd #{current_path} && chmod 755 #{chmod755}"
end
end
====
Note:- The above Capfile will only work if the photos folder is present inside the /home/user/apps/<application>/shared/ folder.
2008-07-01 03:04 PM