Skip to content

Instantly share code, notes, and snippets.

@msuzoagu
Forked from uhlenbrock/deploy.rb
Created August 24, 2019 00:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msuzoagu/38498df1727197df6402bcb12dd7f693 to your computer and use it in GitHub Desktop.
Save msuzoagu/38498df1727197df6402bcb12dd7f693 to your computer and use it in GitHub Desktop.
Precompile assets locally for Capistrano deploy
load 'deploy/assets'
namespace :deploy do
namespace :assets do
desc 'Run the precompile task locally and rsync with shared'
task :precompile, :roles => :web, :except => { :no_release => true } do
%x{bundle exec rake assets:precompile}
%x{rsync --recursive --times --rsh=ssh --compress --human-readable --progress public/assets #{user}@#{host}:#{shared_path}}
%x{bundle exec rake assets:clean}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment