Created
June 12, 2011 16:51
-
-
Save kuon/1021751 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set :domain, "goyman.com" | |
set :application, "goyman.com" | |
set :deploy_to, "/web/sites/#{domain}" | |
set :user, "web" | |
set :use_sudo, false | |
set :scm, :git | |
set :repository, "git@github.com:goyman/Goyman.com.git" | |
set :branch, 'master' | |
set :git_shallow_clone, 1 | |
role :web, domain | |
role :app, domain | |
role :db, domain, :primary => true | |
pid_path = "#{deploy_to}/shared/unicorn.pid" | |
socket_path = "#{deploy_to}/shared/unicorn.sock" | |
start_cmd = %|source "/web/.rvm/scripts/rvm" && rvm use 1.9.2 && socket_path=#{socket_path} pid_path=#{pid_path} unicorn -c config/unicorn.rb -D -E production| | |
stop_cmd = "kill -TERM `cat #{pid_path}`" | |
namespace :deploy do | |
task :finalize_update do | |
run "mkdir -p #{deploy_to}/shared" | |
end | |
task :restart do | |
run "cd #{current_path}; [ -f #{pid_path} ] && kill -TERM `cat #{pid_path}` ; #{start_cmd}" | |
end | |
desc "Start unicorn server" | |
task :start do | |
run "cd #{current_path} && #{start_cmd}" | |
end | |
desc "Stop unicorn server" | |
task :stop do | |
run stop_cmd | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 3 | |
preload_app true | |
timeout 75 | |
listen ENV['socket_path'], :backlog => 2048 | |
pid ENV['pid_path'] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment