Forum: Ruby on Rails Capistrano adding shared files

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Al E. (Guest)
on 2006-04-26 01:27
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 topic is locked and can not be replied to.