Created
July 26, 2013 14:48
-
-
Save kreeger/6089447 to your computer and use it in GitHub Desktop.
A Capistrano recipe for symlinking directories from shared into current/public.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set :public_directories, %w(uploads photos) | |
| namespace :app do | |
| desc "Symlink public directories" | |
| task :symlink_public_directories, :roles => [:app, :db, :web] do | |
| public_directories.each do |directory| | |
| source = File.join(deploy_to, 'shared', directory) | |
| destination = File.join(release_path, 'public', directory) | |
| invoke_command "ln -nfs #{source} #{destination}", :via => run_method | |
| end | |
| end | |
| end | |
| after 'deploy:update_code', 'app:symlink_public_directories' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment