Created
November 15, 2011 20:33
-
-
Save michelson/1368246 to your computer and use it in GitHub Desktop.
fast deploy in rails 3.1
This file contains hidden or 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
# comment out "deploy/assets" in your capfile, we are doing this locally | |
namespace :noumad do | |
desc "Compress assets in a local file" | |
task :compress_assets do | |
run_locally("rm -rf public/assets/*") | |
run_locally("bundle exec rake assets:precompile") | |
run_locally("touch assets.tgz && rm assets.tgz") | |
run_locally("tar zcvf assets.tgz public/assets/") | |
run_locally("mv assets.tgz public/assets/") | |
end | |
desc "Upload assets" | |
task :upload_assets do | |
upload("public/assets/assets.tgz", release_path + '/assets.tgz') | |
run "cd #{release_path}; tar zxvf assets.tgz; rm assets.tgz" | |
run_locally("rm -rf public/assets/*") | |
end | |
end | |
.... | |
after 'deploy:update_code', "noumad:compress_assets" | |
after "deploy:symlink", "noumad:upload_assets" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment