Created
December 14, 2011 17:36
-
-
Save uhlenbrock/1477596 to your computer and use it in GitHub Desktop.
Precompile assets locally for Capistrano deploy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Very helpful. Thanks!
There is a variant for Capistrano 3 and Rails 4
https://gist.github.com/melnikaite/3fa6850b4283865f1543
Thanks a lot. Fixed my problem.
@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
Thanks for the inspiration, I turned this strategy into a rubygem: https://github.com/spagalloco/capistrano-local-precompile