Created
          September 28, 2012 04:38 
        
      - 
      
- 
        Save yachi/3797942 to your computer and use it in GitHub Desktop. 
    precompile rails 3 assets locally
  
        
  
    
      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
    
  
  
    
  | 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 | |
| run_locally("bundle exec rake assets:precompile") | |
| servers = find_servers_for_task(current_task) | |
| port_option = port ? " -e 'ssh -p #{port}' " : '' | |
| servers.each do |server| | |
| run_locally("rsync --recursive --times --rsh=ssh --compress --human-readable #{port_option} --progress public/assets #{user}@#{server}:#{shared_path}") | |
| end | |
| end | |
| end | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment