Sha256: 7d90e356ca6d4a3ccb2cfe35f19127daa4942bba5dec304ed6e2158206a30daa

Contents?: true

Size: 1.05 KB

Versions: 34

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 => :web, :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

34 entries across 34 versions & 2 rubygems

Version Path
ms_deploy-0.1.8 lib/ms_deploy/recipes/symlink.rb
ms_deploy-0.1.7 lib/ms_deploy/recipes/symlink.rb
ms_deploy-0.1.6 lib/ms_deploy/recipes/symlink.rb
ms_deploy-0.1.5 lib/ms_deploy/recipes/symlink.rb
ms_deploy-0.1.4 lib/ms_deploy/recipes/symlink.rb
ms_deploy-0.1.3 lib/ms_deploy/recipes/symlink.rb
ms_deploy-0.1.2 lib/ms_deploy/recipes/symlink.rb
ms_deploy-0.1.1 lib/ms_deploy/recipes/symlink.rb
ms_deploy-0.0.11 lib/ms_deploy/recipes/deploy/symlink.rb
ms_deploy-0.0.10 lib/ms_deploy/recipes/deploy/symlink.rb
ms_deploy-0.0.7 lib/ms_deploy/recipes/deploy/symlink.rb
ms_deploy-0.0.6 lib/ms_deploy/recipes/deploy/symlink.rb
ms_deploy-0.0.5 lib/ms_deploy/recipes/deploy/symlink.rb
ms_deploy-0.0.4 lib/ms_deploy/recipes/deploy/symlink.rb