Sha256: a92be4101ab6c6497c9b225cfaccb6c4d64b2686aae7906c138e3909b8f7cb96

Contents?: true

Size: 919 Bytes

Versions: 28

Compression:

Stored size: 919 Bytes

Contents

Capistrano::Configuration.instance.load do

  load 'deploy/assets' unless ENV['NOASSETS'] # http://guides.rubyonrails.org/asset_pipeline.html#in-production

  set :assets_dir, 'system' unless exists?(:assets_dir)
  set :local_assets_dir, 'public' unless exists?(:local_assets_dir)

  namespace :assets do
    namespace :local do
      desc 'Synchronize your local assets using remote assets'
      task :sync do
        if Util.prompt "Are you sure you want to erase your local assets with server assets"
          servers = find_servers :roles => :app
          [assets_dir].flatten.each do |dir|
            system("rsync -a --del --progress --rsh='ssh -p #{fetch(:ssh_port, 22)}' #{user}@#{servers.first}:#{shared_path}/#{dir}/ #{local_assets_dir}")
          end
        end
      end
    end

    desc 'Synchronize your local assets using remote assets'
    task :pull do
      assets.local.sync
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
ms_deploy-0.3.5 lib/ms_deploy/recipes/assets.rb
ms_deploy-0.3.4 lib/ms_deploy/recipes/assets.rb
ms_deploy-0.3.3 lib/ms_deploy/recipes/assets.rb
ms_deploy-0.3.2 lib/ms_deploy/recipes/assets.rb
ms_deploy-0.3.1 lib/ms_deploy/recipes/assets.rb
ms_deploy-0.3.0 lib/ms_deploy/recipes/assets.rb
ms_deploy-0.2.5 lib/ms_deploy/recipes/assets.rb
ms_deploy-0.2.4 lib/ms_deploy/recipes/assets.rb