Advertisement
Guest User

Untitled

a guest
Mar 26th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.84 KB | None | 0 0
  1. # -*- encoding : utf-8 -*-
  2. require "bundler/capistrano"
  3. #require "rvm/capistrano"
  4.  
  5. set :rvm_type, :system
  6. set :rvm_ruby_string, '2.0.0'
  7.  
  8. set :application, "relacionamento.cartaconsulta.com.br"
  9. set :repository,  "."
  10. set :local_repository, "."
  11. set :deploy_via, :copy
  12. set :deploy_to, "/var/apps/#{application}"
  13.  
  14. set :checkout, "export"
  15.  
  16. role :app, "relacionamento.cartaconsulta.com.br"
  17. role :web, "relacionamento.cartaconsulta.com.br"
  18. role :db, "relacionamento.cartaconsulta.com.br", :primary => true
  19.  
  20. default_run_options[:pty] = true
  21.  
  22. set :use_sudo, false
  23.  
  24. set :user, "root"
  25.  
  26. # if you want to clean up old releases on each deploy uncomment this:
  27. # after "deploy:restart", "deploy:cleanup"
  28.  
  29. # if you're still using the script/reaper helper you will need
  30. # these http://github.com/rails/irs_process_scripts
  31.  
  32. # before "assets:precompile", "deploy:bundle"
  33. before "deploy:assets:precompile", "deploy:db_symlink"
  34.  
  35. # If you are using Passenger mod_rails uncomment this:
  36. namespace :deploy do
  37. #   task :start do ; end
  38. #   task :stop do ; end
  39. #   task :restart, :roles => :app, :except => { :no_release => true } do
  40. #     run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  41. #   end
  42.   desc "Restarting mod_rails with restart.txt"
  43.   task :restart, :roles => :app, :except => { :no_release => true } do
  44.     run "touch #{current_path}/tmp/restart.txt"
  45.   end
  46.  
  47.   task :start, :roles => :app, :except => { :no_release => true } do
  48.     run "cd #{current_path} && RAILS_ENV=production unicorn_rails -c #{current_path}/config/unicorn.rb -D"
  49.   end
  50.  
  51.   task :stop, :roles => :app, :except => { :no_release => true } do
  52.     run "kill -s QUIT `cat /tmp/unicorn.relacionamento.cartaconsulta.com.br.pid`"
  53.   end
  54.  
  55.   task :db_symlink do
  56.     run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
  57.   end
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement