Created
July 15, 2014 22:36
-
-
Save nirvdrum/8d622172ddcd5b8c75ba to your computer and use it in GitHub Desktop.
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 :deploy do | |
desc "precompile and deploy the assets to the server" | |
task :precompile_assets, :roles => :app do | |
if ENV['SKIP_ASSETS'] | |
run "cp -a #{previous_release}/public/assets #{release_path}/public" | |
else | |
run_locally "#{rake} RAILS_ENV=#{rails_env} RAILS_GROUPS=assets assets:precompile" | |
run "mkdir -p #{release_path}/public/assets" | |
transfer(:up, "public/assets", "#{release_path}/public/assets", chunk_size: 16_384) { print "." } | |
run_locally "rm -rf public/assets" # clean up to avoid conflicts with development-mode assets | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment