Skip to content

Instantly share code, notes, and snippets.

View chengdh's full-sized avatar

chengdh

  • 中国郑州
View GitHub Profile
@chengdh
chengdh / unicorn_capistrano.rb
Created May 2, 2012 02:26 — forked from sentientmonkey/unicorn_capistrano.rb
Our deploy for unicorn. It also has magical powers.
set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid"
namespace :unicorn do
desc "start unicorn"
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && #{try_sudo} bundle exec unicorn_rails -c #{current_path}/config/unicorn-#{rails_env}.rb -E #{rails_env} -D"
end
desc "stop unicorn"
task :stop, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} kill `cat #{unicorn_pid}`"