Skip to content

Instantly share code, notes, and snippets.

@zhangyuan
Created February 21, 2013 10:38
Show Gist options
  • Select an option

  • Save zhangyuan/5003822 to your computer and use it in GitHub Desktop.

Select an option

Save zhangyuan/5003822 to your computer and use it in GitHub Desktop.
Capistrano recipe to precompile assets locally and sync public/assets directory to web server.
namespace :deploy do
desc "Sync the public/assets directory."
task :assets_sync do
system('bundle exec rake assets:precompile')
find_servers(:roles => :web).each do |s|
system "rsync -vr --exclude='.DS_Store' public/assets #{user}@#{s}:#{shared_path}/"
end
system('rm -rf public/assets')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment