-
-
Save danmaispace/6433942 to your computer and use it in GitHub Desktop.
Revisions
-
wlangstroth revised this gist
Mar 19, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ server { server { server_name www.example.net; root /srv/net/current/public; location / { try_files $uri @net; -
wlangstroth revised this gist
Mar 19, 2013 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -24,19 +24,19 @@ set :rack_env, :production set :deploy_to, "/srv/#{application}" set :unicorn_conf, "#{current_path}/config/unicorn.rb" set :unicorn_pid, "#{shared_path}/pids/unicorn.pid" set :public_children, ["css","img","js"] namespace :deploy do task :restart do 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" end task :start do run "cd #{current_path} && bundle exec unicorn -c #{unicorn_conf} -E #{rack_env} -D" end task :stop do -
wlangstroth revised this gist
Feb 8, 2013 . 1 changed file with 3 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,26 +8,21 @@ old_pid = pid_file + '.oldbin' timeout 30 worker_processes 2 listen socket_file, :backlog => 1024 pid pid_file stderr_path err_log stdout_path log_file before_fork do |server, worker| # zero downtime deploy magic: # if unicorn is already running, ask it to start a new process and quit. if File.exists?(old_pid) && server.pid != old_pid begin Process.kill("QUIT", File.read(old_pid).to_i) rescue Errno::ENOENT, Errno::ESRCH # already done end end end -
wlangstroth revised this gist
Feb 8, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ require 'bundler/capistrano' set :application, "net" set :repository, "git@githost.com:net.git" set :scm, :git @@ -17,7 +17,7 @@ set :group, user set :runner, user set :host, "#{user}@host.com" role :web, host role :app, host -
wlangstroth revised this gist
Feb 8, 2013 . 1 changed file with 10 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,36 +1,33 @@ require 'bundler/capistrano' set :application, "lila" set :repository, "[email protected]:lila.git" set :scm, :git set :default_environment, { 'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH" } set :use_sudo, false default_run_options[:pty] = true set :user, "deployer" set :group, user set :runner, user set :host, "#{user}@ministryofcomputation.com" role :web, host role :app, host set :rack_env, :production set :deploy_to, "/srv/#{application}" set :unicorn_conf, "#{release_path}/config/unicorn.rb" set :unicorn_pid, "#{deploy_to}/shared/pids/unicorn.pid" set :public_children, ["css","img","js"] namespace :deploy do @@ -46,4 +43,4 @@ run "if [ -f #{unicorn_pid} ]; then kill -QUIT `cat #{unicorn_pid}`; fi" end end -
wlangstroth revised this gist
Sep 18, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ upstream net_unicorn { server unix:/srv/net/shared/unicorn.sock fail_timeout=0; } -
wlangstroth revised this gist
Sep 18, 2012 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ # define paths and filenames deploy_to = "/srv/net" rack_root = "#{deploy_to}/current" pid_file = "#{deploy_to}/shared/pids/unicorn.pid" socket_file= "#{deploy_to}/shared/unicorn.sock" log_file = "#{rack_root}/log/unicorn.log" err_log = "#{rack_root}/log/unicorn_error.log" old_pid = pid_file + '.oldbin' timeout 30 -
wlangstroth revised this gist
Sep 18, 2012 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -15,9 +15,6 @@ stderr_path err_log stdout_path log_file # make sure that Bundler finds the Gemfile before_exec do |server| ENV['BUNDLE_GEMFILE'] = File.expand_path('../Gemfile', File.dirname(__FILE__)) -
wlangstroth renamed this gist
Sep 18, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
wlangstroth renamed this gist
Sep 18, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,49 @@ $:.unshift(File.expand_path('./lib', ENV['rvm_path'])) require 'rvm/capistrano' require 'bundler/capistrano' set :rvm_ruby_string, '1.9.3' set :rvm_type, :user set :application, "net" set :repository, "[email protected]:net.git" set :scm, :git set :use_sudo, false set(:run_method) { use_sudo ? :sudo : :run } default_run_options[:pty] = true set :user, "deployer" set :group, user set :runner, user set :host, "#{user}@example.net" role :web, host role :app, host set :rack_env, :production set :deploy_to, "/srv/#{application}" set :unicorn_conf, "#{deploy_to}/current/config/unicorn.rb" set :unicorn_pid, "#{deploy_to}/shared/pids/unicorn.pid" set :public_children, ["img","js","css"] # comment out to keep the default ["images" ...] namespace :deploy do task :restart do run "if [ -f #{unicorn_pid} ]; then kill -USR2 `cat #{unicorn_pid}`; else cd #{deploy_to}/current && bundle exec unicorn -c #{unicorn_conf} -E #{rack_env} -D; fi" end task :start do run "cd #{deploy_to}/current && bundle exec unicorn -c #{unicorn_conf} -E #{rack_env} -D" end task :stop do run "if [ -f #{unicorn_pid} ]; then kill -QUIT `cat #{unicorn_pid}`; fi" end end This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ pstream net_unicorn { server unix:/srv/net/shared/unicorn.sock fail_timeout=0; } server { server_name example.net; rewrite ^(.*) http://www.example.net$1 permanent; } server { server_name www.example.net; root /srv/net/public; location / { try_files $uri @net; } location @net { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://net_unicorn; } } This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ # define paths and filenames deploy_to = "/srv/net" rails_root = "#{deploy_to}/current" pid_file = "#{deploy_to}/shared/pids/unicorn.pid" socket_file= "#{deploy_to}/shared/unicorn.sock" log_file = "#{rails_root}/log/unicorn.log" err_log = "#{rails_root}/log/unicorn_error.log" old_pid = pid_file + '.oldbin' timeout 30 worker_processes 4 listen socket_file, :backlog => 1024 pid pid_file stderr_path err_log stdout_path log_file # make forks faster preload_app true # make sure that Bundler finds the Gemfile before_exec do |server| ENV['BUNDLE_GEMFILE'] = File.expand_path('../Gemfile', File.dirname(__FILE__)) end before_fork do |server, worker| # zero downtime deploy magic: # if unicorn is already running, ask it to start a new process and quit. 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