Sha256: 2cf90e965d37e3c26941ca817efb346a00596900e9538f5318065f8ac5a7c539

Contents?: true

Size: 1.05 KB

Versions: 13

Compression:

Stored size: 1.05 KB

Contents

Capistrano::Configuration.instance.load do

  namespace :deploy do
    desc <<-DESC
      Symlink shared directories and files.
    DESC
    task :symlink_dependencies, :roles => :app, :except => {:no_release => true} do
      shared_directories_to_link   = fetch(:shared_directories_to_link, [])
      directories_to_create        = fetch(:directories_to_create, [])
      files_to_delete              = fetch(:files_to_delete, [])
      files_to_link                = fetch(:files_to_link, {})
      chmods_to_set                = fetch(:chmods_to_set, [])

      directories_to_create.each        { |directory| run "mkdir -p #{directory}" }
      shared_directories_to_link.each   { |source, target| run "ln -s #{source} #{target}" }
      files_to_delete.each              { |file| run "rm #{file}" }
      files_to_link.each                { |source, target| run "ln -s #{source} #{target}"}
      chmods_to_set.each                { |target, chmod| run "chmod #{chmod} #{target}" }
    end
  end

  after 'deploy:finalize_update', 'deploy:symlink_dependencies'

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
caploy-0.2.5 lib/caploy/recipes/symlink.rb
caploy-0.2.4 lib/caploy/recipes/symlink.rb
caploy-0.2.3 lib/caploy/recipes/symlink.rb
caploy-0.2.2 lib/caploy/recipes/symlink.rb
caploy-0.2.1 lib/caploy/recipes/symlink.rb
caploy-0.2.0 lib/caploy/recipes/symlink.rb
caploy-0.1.12 lib/caploy/recipes/symlink.rb
caploy-0.1.11 lib/caploy/recipes/symlink.rb
caploy-0.1.10 lib/caploy/recipes/symlink.rb
caploy-0.1.9 lib/caploy/recipes/symlink.rb
caploy-0.1.8 lib/caploy/recipes/symlink.rb
caploy-0.1.7 lib/caploy/recipes/symlink.rb
caploy-0.1.6 lib/caploy/recipes/symlink.rb