Skip to content

Instantly share code, notes, and snippets.

@itsNikolay
Created November 11, 2011 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itsNikolay/1358692 to your computer and use it in GitHub Desktop.
Save itsNikolay/1358692 to your computer and use it in GitHub Desktop.
set :application, "ponomarevnikolay.ru"
set :rails_env, "production"
set :domain, "deployer@ponomarevnikolay.ru"
set :deploy_to, "/home/deployer/projects/#{application}"
set :use_sudo, false
set :unicorn_conf, "#{deploy_to}/current/config/unicorn.rb"
set :unicorn_pid, "#{deploy_to}/shared/pids/unicorn.pid"
set :application, "ponomarevnikolay.ru"
set :rails_env, "production"
set :domain, "deployer@ponomarevnikolay.ru"
set :deploy_to, "/home/deployer/projects/#{application}"
set :use_sudo, false
set :unicorn_conf, "#{deploy_to}/current/config/unicorn.rb"
set :unicorn_pid, "#{deploy_to}/shared/pids/unicorn.pid"
set :user, "deployer"
set :runner, "deployer"
set :password, "сектрет"
role :web, domain
role :app, domain
role :db, domain, :primary => true
namespace :deploy do
task :restart do
run "if [ -f #{unicorn_pid} ] && [ -e /proc/$(cat #{unicorn_pid}) ]; then kill -USR2 `cat #{unicorn_pid}`; else cd #{deploy_to}/current && bundle exec unicorn -c #{unicorn_conf} -E #{rails_env} -D; fi"
end
task :start do
run "bundle exec unicorn -c #{unicorn_conf} -E #{rails_env} -D"
end
task :stop do
run "if [ -f #{unicorn_pid} ] && [ -e /proc/$(cat #{unicorn_pid}) ]; then kill -QUIT `cat #{unicorn_pid}`; fi"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment