Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
@stve

This comment has been minimized.

Copy link

commented Oct 4, 2013

Thanks for the inspiration, I turned this strategy into a rubygem: https://github.com/spagalloco/capistrano-local-precompile

@billguy

This comment has been minimized.

Copy link

commented Feb 8, 2014

Very helpful. Thanks!

@melnikaite

This comment has been minimized.

Copy link

commented Jul 9, 2014

There is a variant for Capistrano 3 and Rails 4
https://gist.github.com/melnikaite/3fa6850b4283865f1543

@hootan-nik

This comment has been minimized.

Copy link

commented Jul 17, 2014

Thanks a lot. Fixed my problem.

@vassilevsky

This comment has been minimized.

Copy link

commented Dec 1, 2017

@stve Thanks for the gem! It works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.