Last active
December 20, 2015 22:39
-
-
Save j-mcnally/6206935 to your computer and use it in GitHub Desktop.
Compile assets locally when working in low-memory environments
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
namespace :assets do | |
desc "compile assets locally and upload before finalize_update" | |
task :deploy do | |
%x[RAILS_ENV=production bundle exec rake assets:clean && RAILS_ENV=production bundle exec rake assets:precompile] | |
run "sudo rm -rf #{release_path}/public/assets" | |
ENV['COMMAND'] = " mkdir '#{release_path}/public/assets'" | |
invoke | |
path = File.expand_path("../../public/assets", __FILE__) | |
puts path | |
upload path, "#{release_path}/public/assets", {:recursive => true} | |
%x[bundle exec rake assets:clean] | |
end | |
end | |
after "deploy:finalize_update", "assets:deploy" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment