From 2fbd01a769a3895f39dcadb11a611ba6ec37c8b0 Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sat, 11 May 2013 09:22:08 -0400 Subject: [PATCH 01/16] added Proc for heroku --- Procfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 Procfile diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..9249f1e --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb \ No newline at end of file From 690ddae5fd5caa493662906c0bcb3c1a679f9a9a Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 12 May 2013 11:12:45 -0400 Subject: [PATCH 02/16] added capistrano for rvm deploy --- config/deploy_rvm.rb | 55 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 config/deploy_rvm.rb diff --git a/config/deploy_rvm.rb b/config/deploy_rvm.rb new file mode 100644 index 0000000..4b9ba82 --- /dev/null +++ b/config/deploy_rvm.rb @@ -0,0 +1,55 @@ +require "bundler/capistrano" +require 'rvm/capistrano' +set :rvm_ruby_string, :local + +server "192.34.61.70", :web, :app, :db, primary: true + +set :application, "blog" +set :user, "ken" +set :deploy_to, "/home/#{user}/apps/#{application}" +set :deploy_via, :copy +set :use_sudo, false + +#set :scm, "git" +#set :repository, "git@github.com:jerry134/#{application}.git" +set :repository, '.'#"https://github.com/jerry134/#{application}.git" +set :branch, "master" + +default_run_options[:pty] = true +ssh_options[:forward_agent] = true + +after "deploy", "deploy:cleanup" # keep only the last 5 releases +before 'deploy:setup', 'rvm:create_gemset' + +namespace :deploy do + %w[start stop restart].each do |command| + desc "#{command} unicorn server" + task command, roles: :app, except: {no_release: true} do + run "/etc/init.d/unicorn_#{application} #{command}" + end + end + + task :setup_config, roles: :app do + sudo "ln -nfs #{current_path}/config/nginx.conf /etc/nginx/sites-enabled/#{application}" + sudo "ln -nfs #{current_path}/config/unicorn_init.sh /etc/init.d/unicorn_#{application}" + run "mkdir -p #{shared_path}/config" + put File.read("config/database.example.yml"), "#{shared_path}/config/database.yml" + puts "Now edit the config files in #{shared_path}." + end + after "deploy:setup", "deploy:setup_config" + + task :symlink_config, roles: :app do + run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml" + end + after "deploy:finalize_update", "deploy:symlink_config" + + desc "Make sure local git is in sync with remote." + task :check_revision, roles: :web do + unless `git rev-parse HEAD` == `git rev-parse origin/master` + puts "WARNING: HEAD is not the same as origin/master" + puts "Run `git push` to sync changes." + exit + end + end + before "deploy", "deploy:check_revision" +end From 398634333341b89715f53041c446a14a6a3f03c5 Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 12 May 2013 11:13:54 -0400 Subject: [PATCH 03/16] added rvm capistrano --- Gemfile | 2 +- Gemfile.lock | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 94812f4..b5cf01e 100644 --- a/Gemfile +++ b/Gemfile @@ -46,7 +46,7 @@ gem 'formtastic-bootstrap' gem 'unicorn' # Deploy with Capistrano -gem 'capistrano' +gem 'rvm-capistrano' # To use debugger # gem 'debugger' diff --git a/Gemfile.lock b/Gemfile.lock index 33e1c16..ee619e3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -108,6 +108,8 @@ GEM rdoc (3.12.2) json (~> 1.4) ref (1.0.4) + rvm-capistrano (1.3.0) + capistrano (>= 2.0.0) sass (3.2.8) sass-rails (3.2.6) railties (~> 3.2.0) @@ -146,7 +148,6 @@ PLATFORMS ruby DEPENDENCIES - capistrano coffee-rails (~> 3.2.1) commonjs formtastic @@ -157,6 +158,7 @@ DEPENDENCIES libv8 (~> 3.11.8) mysql2 rails (= 3.2.13) + rvm-capistrano sass-rails (~> 3.2.3) simple_form therubyracer From bf48e730f5c64ef20eb78ce2d314a7261066443d Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 12 May 2013 12:28:24 -0400 Subject: [PATCH 04/16] for deploy share --- Gemfile | 4 ++-- Gemfile.lock | 2 +- config/database.example.yml | 2 +- config/deploy.rb | 12 ++++++------ 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index b5cf01e..f9974e5 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ -#source 'https://rubygems.org' -source 'http://ruby.taobao.org' +source 'https://rubygems.org' +#source 'http://ruby.taobao.org' gem 'rails', '3.2.13' diff --git a/Gemfile.lock b/Gemfile.lock index ee619e3..64e0646 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,5 +1,5 @@ GEM - remote: http://ruby.taobao.org/ + remote: https://rubygems.org/ specs: actionmailer (3.2.13) actionpack (= 3.2.13) diff --git a/config/database.example.yml b/config/database.example.yml index 348e564..faa43ba 100644 --- a/config/database.example.yml +++ b/config/database.example.yml @@ -38,5 +38,5 @@ production: database: blog_production pool: 5 username: root - password: + password: password socket: /var/run/mysqld/mysqld.sock diff --git a/config/deploy.rb b/config/deploy.rb index 9f38025..35dff1f 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,17 +1,17 @@ require "bundler/capistrano" -server "42.121.122.34", :web, :app, :db, primary: true +server "198.199.86.209", :web, :app, :db, primary: true set :application, "blog" -set :user, "root" +set :user, "ruby" set :deploy_to, "/home/#{user}/apps/#{application}" -set :deploy_via, :remote_cache +set :deploy_via, :copy#remote_cache set :use_sudo, false -set :scm, "git" +#set :scm, "git" #set :repository, "git@github.com:jerry134/#{application}.git" -set :repository, "https://github.com/jerry134/#{application}.git" -set :branch, "master" +set :repository, '.'#"https://github.com/jerry134/#{application}.git" +#set :branch, "master" default_run_options[:pty] = true ssh_options[:forward_agent] = true From 07e0025af5765905be4780f425cff9d0e4f2ac34 Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 12 May 2013 12:36:53 -0400 Subject: [PATCH 05/16] added capistrano rbenv --- Gemfile | 1 + Gemfile.lock | 6 ++++++ config/deploy.rb | 1 + 3 files changed, 8 insertions(+) diff --git a/Gemfile b/Gemfile index f9974e5..a88254b 100644 --- a/Gemfile +++ b/Gemfile @@ -47,6 +47,7 @@ gem 'unicorn' # Deploy with Capistrano gem 'rvm-capistrano' +gem 'capistrano-rbenv' # To use debugger # gem 'debugger' diff --git a/Gemfile.lock b/Gemfile.lock index 64e0646..96489d3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -36,6 +36,11 @@ GEM net-sftp (>= 2.0.0) net-ssh (>= 2.0.14) net-ssh-gateway (>= 1.1.0) + capistrano-platform-resources (0.1.3) + capistrano (< 3) + capistrano-rbenv (1.0.5) + capistrano (< 3) + capistrano-platform-resources (>= 0.1.3) coffee-rails (3.2.2) coffee-script (>= 2.2.0) railties (~> 3.2.0) @@ -148,6 +153,7 @@ PLATFORMS ruby DEPENDENCIES + capistrano-rbenv coffee-rails (~> 3.2.1) commonjs formtastic diff --git a/config/deploy.rb b/config/deploy.rb index 35dff1f..a1ba0cc 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,4 +1,5 @@ require "bundler/capistrano" +require 'capistrano-rbenv' server "198.199.86.209", :web, :app, :db, primary: true From 5021e7fe8af0f90fefbf80c4c266f9fab27bfe39 Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 12 May 2013 12:42:14 -0400 Subject: [PATCH 06/16] modify unicorn config --- config/unicorn.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/unicorn.rb b/config/unicorn.rb index 1bf8f70..7969fe6 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -1,4 +1,4 @@ -root = "/home/root/apps/blog/current" +root = "/home/ruby/apps/blog/current" working_directory root pid "#{root}/tmp/pids/unicorn.pid" stderr_path "#{root}/log/unicorn.log" From a434bd26e51a2243ec4806fc4f847fe65b2b2845 Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 12 May 2013 13:05:38 -0400 Subject: [PATCH 07/16] added capistrano unicorn --- Capfile | 2 +- Gemfile | 7 +++-- config/deploy.rb | 69 +++++++++++++++++++++++++----------------------- 3 files changed, 42 insertions(+), 36 deletions(-) diff --git a/Capfile b/Capfile index 447fe75..e5361f2 100644 --- a/Capfile +++ b/Capfile @@ -1,4 +1,4 @@ load 'deploy' # Uncomment if you are using Rails' asset pipeline -load 'deploy/assets' +#load 'deploy/assets' load 'config/deploy' # remove this line to skip loading any of the default tasks diff --git a/Gemfile b/Gemfile index a88254b..92b2d98 100644 --- a/Gemfile +++ b/Gemfile @@ -46,8 +46,11 @@ gem 'formtastic-bootstrap' gem 'unicorn' # Deploy with Capistrano -gem 'rvm-capistrano' -gem 'capistrano-rbenv' +group :development do + gem 'rvm-capistrano' + gem 'capistrano-rbenv' + gem 'capistrano-unicorn', require: false +end # To use debugger # gem 'debugger' diff --git a/config/deploy.rb b/config/deploy.rb index a1ba0cc..d413b9d 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,5 +1,6 @@ require "bundler/capistrano" require 'capistrano-rbenv' +require 'capistrano-unicorn' server "198.199.86.209", :web, :app, :db, primary: true @@ -18,36 +19,38 @@ ssh_options[:forward_agent] = true after "deploy", "deploy:cleanup" # keep only the last 5 releases - -namespace :deploy do - %w[start stop restart].each do |command| - desc "#{command} unicorn server" - task command, roles: :app, except: {no_release: true} do - run "/etc/init.d/unicorn_#{application} #{command}" - end - end - - task :setup_config, roles: :app do - sudo "ln -nfs #{current_path}/config/nginx.conf /etc/nginx/sites-enabled/#{application}" - sudo "ln -nfs #{current_path}/config/unicorn_init.sh /etc/init.d/unicorn_#{application}" - run "mkdir -p #{shared_path}/config" - put File.read("config/database.example.yml"), "#{shared_path}/config/database.yml" - puts "Now edit the config files in #{shared_path}." - end - after "deploy:setup", "deploy:setup_config" - - task :symlink_config, roles: :app do - run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml" - end - after "deploy:finalize_update", "deploy:symlink_config" - - desc "Make sure local git is in sync with remote." - task :check_revision, roles: :web do - unless `git rev-parse HEAD` == `git rev-parse origin/master` - puts "WARNING: HEAD is not the same as origin/master" - puts "Run `git push` to sync changes." - exit - end - end - before "deploy", "deploy:check_revision" -end +after 'deploy:restart', 'unicorn:reload' +after 'deploy:restart', 'unicorn:restart' + +#namespace :deploy do + #%w[start stop restart].each do |command| + #desc "#{command} unicorn server" + #task command, roles: :app, except: {no_release: true} do + #run "/etc/init.d/unicorn_#{application} #{command}" + #end + #end + + #task :setup_config, roles: :app do + #sudo "ln -nfs #{current_path}/config/nginx.conf /etc/nginx/sites-enabled/#{application}" + #sudo "ln -nfs #{current_path}/config/unicorn_init.sh /etc/init.d/unicorn_#{application}" + #run "mkdir -p #{shared_path}/config" + #put File.read("config/database.example.yml"), "#{shared_path}/config/database.yml" + #puts "Now edit the config files in #{shared_path}." + #end + #after "deploy:setup", "deploy:setup_config" + + #task :symlink_config, roles: :app do + #run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml" + #end + #after "deploy:finalize_update", "deploy:symlink_config" + + #desc "Make sure local git is in sync with remote." + #task :check_revision, roles: :web do + #unless `git rev-parse HEAD` == `git rev-parse origin/master` + #puts "WARNING: HEAD is not the same as origin/master" + #puts "Run `git push` to sync changes." + #exit + #end + #end + #before "deploy", "deploy:check_revision" +#end From d0d6ad6a439f967792e118474755e2a3c1f5612a Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 12 May 2013 13:08:24 -0400 Subject: [PATCH 08/16] for unicorn capistrano --- Gemfile.lock | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index 96489d3..b892ff9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -41,6 +41,8 @@ GEM capistrano-rbenv (1.0.5) capistrano (< 3) capistrano-platform-resources (>= 0.1.3) + capistrano-unicorn (0.1.7) + capistrano coffee-rails (3.2.2) coffee-script (>= 2.2.0) railties (~> 3.2.0) @@ -154,6 +156,7 @@ PLATFORMS DEPENDENCIES capistrano-rbenv + capistrano-unicorn coffee-rails (~> 3.2.1) commonjs formtastic From 07f917fa01fc1900952c59285b6d915e85bc48cc Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 12 May 2013 13:27:45 -0400 Subject: [PATCH 09/16] modified unicorn configuration --- config/unicorn.rb | 51 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/config/unicorn.rb b/config/unicorn.rb index 7969fe6..df690f8 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -1,10 +1,45 @@ -root = "/home/ruby/apps/blog/current" -working_directory root -pid "#{root}/tmp/pids/unicorn.pid" -stderr_path "#{root}/log/unicorn.log" -stdout_path "#{root}/log/unicorn.log" +#root = "/home/ruby/apps/blog/current" +#pid "#{root}/tmp/pids/unicorn.pid" -listen "/tmp/unicorn.blog.sock" -worker_processes 2 -timeout 30 +#listen "/tmp/unicorn.blog.sock" +app_path = "/home/ruby/apps/blog/current" + +# Set unicorn options +worker_processes 1 +preload_app true +timeout 180 +listen "127.0.0.1:9000" + +# Spawn unicorn master worker for user apps (group: apps) +user 'ruby', 'ruby' + +# Fill path to your app +working_directory app_path + +# Should be 'production' by default, otherwise use other env +rails_env = ENV['RAILS_ENV'] || 'production' + +# Log everything to one file +stderr_path "log/unicorn.log" +stdout_path "log/unicorn.log" + +# Set master PID location +pid "#{app_path}/tmp/pids/unicorn.pid" + +before_fork do |server, worker| + ActiveRecord::Base.connection.disconnect! + + old_pid = "#{server.config[:pid]}.oldbin" + if File.exists?(old_pid) && server.pid != old_pid + begin + Process.kill("QUIT", File.read(old_pid).to_i) + rescue Errno::ENOENT, Errno::ESRCH + # someone else did our job for us + end + end +end + +after_fork do |server, worker| + ActiveRecord::Base.establish_connection +end From a17865ef75e8494db6cf8c485478c6c022bd0565 Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 12 May 2013 13:30:11 -0400 Subject: [PATCH 10/16] configuration for capistrano unicorn --- config/unicorn/unicorn.rb | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 config/unicorn/unicorn.rb diff --git a/config/unicorn/unicorn.rb b/config/unicorn/unicorn.rb new file mode 100644 index 0000000..df690f8 --- /dev/null +++ b/config/unicorn/unicorn.rb @@ -0,0 +1,45 @@ +#root = "/home/ruby/apps/blog/current" +#pid "#{root}/tmp/pids/unicorn.pid" + +#listen "/tmp/unicorn.blog.sock" + +app_path = "/home/ruby/apps/blog/current" + +# Set unicorn options +worker_processes 1 +preload_app true +timeout 180 +listen "127.0.0.1:9000" + +# Spawn unicorn master worker for user apps (group: apps) +user 'ruby', 'ruby' + +# Fill path to your app +working_directory app_path + +# Should be 'production' by default, otherwise use other env +rails_env = ENV['RAILS_ENV'] || 'production' + +# Log everything to one file +stderr_path "log/unicorn.log" +stdout_path "log/unicorn.log" + +# Set master PID location +pid "#{app_path}/tmp/pids/unicorn.pid" + +before_fork do |server, worker| + ActiveRecord::Base.connection.disconnect! + + old_pid = "#{server.config[:pid]}.oldbin" + if File.exists?(old_pid) && server.pid != old_pid + begin + Process.kill("QUIT", File.read(old_pid).to_i) + rescue Errno::ENOENT, Errno::ESRCH + # someone else did our job for us + end + end +end + +after_fork do |server, worker| + ActiveRecord::Base.establish_connection +end From a3fc26076638aaff180ca8c548ea156ba97efc37 Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 12 May 2013 14:11:34 -0400 Subject: [PATCH 11/16] changed unicorn port --- config/deploy.rb | 12 ++++++------ config/unicorn.rb | 2 +- config/unicorn/unicorn.rb | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index d413b9d..036167d 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -22,7 +22,7 @@ after 'deploy:restart', 'unicorn:reload' after 'deploy:restart', 'unicorn:restart' -#namespace :deploy do +namespace :deploy do #%w[start stop restart].each do |command| #desc "#{command} unicorn server" #task command, roles: :app, except: {no_release: true} do @@ -39,10 +39,10 @@ #end #after "deploy:setup", "deploy:setup_config" - #task :symlink_config, roles: :app do - #run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml" - #end - #after "deploy:finalize_update", "deploy:symlink_config" + task :symlink_config, roles: :app do + run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml" + end + after "deploy:finalize_update", "deploy:symlink_config" #desc "Make sure local git is in sync with remote." #task :check_revision, roles: :web do @@ -53,4 +53,4 @@ #end #end #before "deploy", "deploy:check_revision" -#end +end diff --git a/config/unicorn.rb b/config/unicorn.rb index df690f8..e334c9d 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -9,7 +9,7 @@ worker_processes 1 preload_app true timeout 180 -listen "127.0.0.1:9000" +listen 9000 #"127.0.0.1:9000" # Spawn unicorn master worker for user apps (group: apps) user 'ruby', 'ruby' diff --git a/config/unicorn/unicorn.rb b/config/unicorn/unicorn.rb index df690f8..e334c9d 100644 --- a/config/unicorn/unicorn.rb +++ b/config/unicorn/unicorn.rb @@ -9,7 +9,7 @@ worker_processes 1 preload_app true timeout 180 -listen "127.0.0.1:9000" +listen 9000 #"127.0.0.1:9000" # Spawn unicorn master worker for user apps (group: apps) user 'ruby', 'ruby' From 60b4748c74ea8f95a928956d2c3b77d62c6d48d8 Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 12 May 2013 14:18:51 -0400 Subject: [PATCH 12/16] remove pid to restart --- config/unicorn.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/unicorn.rb b/config/unicorn.rb index e334c9d..2e210b7 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -25,7 +25,7 @@ stdout_path "log/unicorn.log" # Set master PID location -pid "#{app_path}/tmp/pids/unicorn.pid" +#pid "#{app_path}/tmp/pids/unicorn.pid" before_fork do |server, worker| ActiveRecord::Base.connection.disconnect! From 332fd69e53750cc463c5ca90f3cb5ebc612df7cb Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 12 May 2013 14:26:49 -0400 Subject: [PATCH 13/16] changed to unicorn rails --- config/deploy.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/deploy.rb b/config/deploy.rb index 036167d..8226be8 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -9,6 +9,7 @@ set :deploy_to, "/home/#{user}/apps/#{application}" set :deploy_via, :copy#remote_cache set :use_sudo, false +set :unicorn_binary, 'unicorn_rails' #set :scm, "git" #set :repository, "git@github.com:jerry134/#{application}.git" From ec57e804a204b2de29829a580893c693c38902e1 Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 12 May 2013 14:58:37 -0400 Subject: [PATCH 14/16] updated deploy file --- config/deploy.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/config/deploy.rb b/config/deploy.rb index 8226be8..317677d 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -31,6 +31,17 @@ #end #end + task :start do + run "unicorn_rails -c config/unicorn.rb -E production -D" + end + task :stop do + run "ps aux | grep unicorn | grep -v grep | awk '{print $2}' | xargs kill -s 9" + end + task :restart do + run "ps aux | grep unicorn | grep -v grep | awk '{print $2}' | xargs kill -s 9" + run "unicorn_rails -c config/unicorn.rb -E production -D" + end + #task :setup_config, roles: :app do #sudo "ln -nfs #{current_path}/config/nginx.conf /etc/nginx/sites-enabled/#{application}" #sudo "ln -nfs #{current_path}/config/unicorn_init.sh /etc/init.d/unicorn_#{application}" From a4ca5c42de3d8f4f894a5387641bd06348f25d83 Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 12 May 2013 15:01:27 -0400 Subject: [PATCH 15/16] relative path --- config/deploy.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index 317677d..bd1b153 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -32,14 +32,14 @@ #end task :start do - run "unicorn_rails -c config/unicorn.rb -E production -D" + run "#{release_path}/unicorn_rails -c #{release_path}/config/unicorn.rb -E production -D" end task :stop do run "ps aux | grep unicorn | grep -v grep | awk '{print $2}' | xargs kill -s 9" end task :restart do run "ps aux | grep unicorn | grep -v grep | awk '{print $2}' | xargs kill -s 9" - run "unicorn_rails -c config/unicorn.rb -E production -D" + run "#{release_path}/unicorn_rails -c #{release_path}/config/unicorn.rb -E production -D" end #task :setup_config, roles: :app do From 00e4c902751ebe7e85caafd4a04876f5fa9039f6 Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 12 May 2013 15:03:06 -0400 Subject: [PATCH 16/16] path --- config/deploy.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index bd1b153..b0e617a 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -32,14 +32,14 @@ #end task :start do - run "#{release_path}/unicorn_rails -c #{release_path}/config/unicorn.rb -E production -D" + run "unicorn_rails -c #{release_path}/config/unicorn.rb -E production -D" end task :stop do run "ps aux | grep unicorn | grep -v grep | awk '{print $2}' | xargs kill -s 9" end task :restart do run "ps aux | grep unicorn | grep -v grep | awk '{print $2}' | xargs kill -s 9" - run "#{release_path}/unicorn_rails -c #{release_path}/config/unicorn.rb -E production -D" + run "unicorn_rails -c #{release_path}/config/unicorn.rb -E production -D" end #task :setup_config, roles: :app do