Sha256: 64e936aae3cb1ee47db3b7f83cf8399a5e110580a39d7677550c22fc97d56c2d

Contents?: true

Size: 830 Bytes

Versions: 1

Compression:

Stored size: 830 Bytes

Contents

namespace :deploy do
  # Rake::Task["deploy:assets:precompile"].clear_actions

  desc "Compiles assets locally then rsync to server"
  task :compile_assets_locally do
    asset_prefix = fetch(:asset_prefix, "assets")
    run_locally do
      execute "RAILS_ENV=#{fetch(:rails_env)} bundle exec rake assets:precompile"
    end
    on roles(:app) do |role|
      run_locally do
        execute "rsync -av --delete ./public/#{asset_prefix}/ #{role.user}@#{role.hostname}:#{shared_path}/public/#{asset_prefix}/;"
        execute "rsync -av --delete ./public/packs/ #{role.user}@#{role.hostname}:#{shared_path}/public/packs/;"
      end
      execute "chmod -R 755 #{shared_path}/public/#{asset_prefix}"
    end
    run_locally do
      execute "rm -rf ./public/#{asset_prefix}"
      execute "rm -rf ./public/packs"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
meataxe-0.6.2 lib/meataxe/capistrano/tasks/compile_assets_locally.cap