Capistrano adding shared files

I’m finding the :before_task and :after_task facilities in Capistrano
very useful.

For example, I needed to add a shared directory to my system. All I had
to do was add a few lines to deploy.rb:

desc “Add shared usr_img directory to shared”
task :after_setup do
run <<-CMD
mkdir -p -m 775 #{shared_path}/user_img
CMD
end

desc “Link shared usr_img directory to public/usr_img”
task :after_update_code do
run <<-CMD
ln -nfs #{shared_path}/user_img #{release_path}/public/user_img
CMD
end

Whee!

–Al Evans

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs