ruby on rails 4 - In capistrano 3, is it possible to bundle & asset precompile locally and copy the results to application server? -


at present, have setup capistrano git pulls latest code on production servers, bundle installs , asset precompiles individually on each web server.

the problem running occationally take long time , take lot of resources impacts performance on production servers.

i looking guidelines on how best this.

if has experience , can share opinions, appreciate it.

i looking see if good/bad idea , common pitfalls should watch out for.

i appreciate link blog post/tutorial/documentation this.

thanks reading.

  • ankit.

here work around. try adding in namespace :deploy

namespace :assets   desc 'run precompile task locally , rsync shared'   task :precompile, :roles => :web, :except => { :no_release => true }     unless skip_assets       %x{bundle exec rake assets:clean rails_env=#{rails_env}}       run_local "bundle exec rake assets:precompile rails_env=#{rails_env}"       servers = find_servers_for_task(current_task)       port_option = port ? "-e 'ssh -p #{port}'" : ''       servers.each |server|         %x{rsync --recursive --times --rsh=ssh --compress --human-readable --progress #{port_option} public/assets #{user}@#{server}:#{shared_path}}       end       %x{bundle exec rake assets:clean rails_env=#{rails_env}}     end   end end  def run_local(cmd)   system cmd   if($?.exitstatus != 0)     puts 'exit code: ' + $?.exitstatus.to_s     exit   end end 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -