Advertisement
Guest User

Untitled

a guest
May 29th, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. require 'bundler/capistrano'
  2.  
  3. set :application, "net"
  4. set :repository, "git@githost.com:net.git"
  5.  
  6. set :scm, :git
  7.  
  8. set :default_environment, {
  9. 'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
  10. }
  11.  
  12. set :use_sudo, false
  13.  
  14. default_run_options[:pty] = true
  15.  
  16. set :user, "deployer"
  17. set :group, user
  18. set :runner, user
  19.  
  20. set :host, "#{user}@host.com"
  21. role :web, host
  22. role :app, host
  23.  
  24. set :rack_env, :production
  25.  
  26. set :deploy_to, "/srv/#{application}"
  27. set :unicorn_conf, "#{current_path}/config/unicorn.rb"
  28. set :unicorn_pid, "#{shared_path}/pids/unicorn.pid"
  29.  
  30. set :public_children, ["css","img","js"]
  31.  
  32. namespace :deploy do
  33.  
  34. task :restart do
  35. run "if [ -f #{unicorn_pid} ]; then kill -USR2 `cat #{unicorn_pid}`; else cd #{current_path} && bundle exec unicorn -c #{unicorn_conf} -E #{rack_env} -D; fi"
  36. end
  37.  
  38. task :start do
  39. run "cd #{current_path} && bundle exec unicorn -c #{unicorn_conf} -E #{rack_env} -D"
  40. end
  41.  
  42. task :stop do
  43. run "if [ -f #{unicorn_pid} ]; then kill -QUIT `cat #{unicorn_pid}`; fi"
  44. end
  45.  
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement