-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
88 additions
and
99 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,35 @@ | ||
require 'mina/bundler' | ||
require 'mina/rails' | ||
require 'mina/unicorn/utility' | ||
require "mina/bundler" | ||
require "mina/rails" | ||
require "mina/unicorn/utility" | ||
|
||
namespace :unicorn do | ||
include Mina::Unicorn::Utility | ||
|
||
# Following recommendations from http://unicorn.bogomips.org/unicorn_1.html#rack-environment | ||
set_default :unicorn_env, -> { fetch(:rails_env) == 'development' ? 'development' : 'deployment' } | ||
set_default :unicorn_config, -> { "#{deploy_to}/#{current_path}/config/unicorn.rb" } | ||
set_default :unicorn_pid, -> { "#{deploy_to}/#{current_path}/tmp/pids/unicorn.pid" } | ||
set_default :unicorn_cmd, -> { "#{bundle_prefix} unicorn" } | ||
set_default :unicorn_restart_sleep_time, -> { 2 } | ||
set_default :bundle_gemfile, -> { "#{deploy_to}/#{current_path}/Gemfile" } | ||
set :unicorn_env, -> { fetch(:rails_env) == "development" ? "development" : "deployment" } | ||
set :unicorn_config, -> { "#{fetch(:current_path)}/config/unicorn.rb" } | ||
set :unicorn_pid, -> { "#{fetch(:current_path)}/tmp/pids/unicorn.pid" } | ||
set :unicorn_cmd, -> { "#{fetch(:bundle_prefix)} unicorn" } | ||
set :unicorn_restart_sleep_time, -> { 2 } | ||
set :bundle_gemfile, -> { "#{fetch(:current_path)}/Gemfile" } | ||
|
||
desc "Start Unicorn master process" | ||
task start: :environment do | ||
queue start_unicorn | ||
command start_unicorn | ||
end | ||
|
||
desc "Stop Unicorn" | ||
task stop: :environment do | ||
queue kill_unicorn('QUIT') | ||
command kill_unicorn("QUIT") | ||
end | ||
|
||
desc "Immediately shutdown Unicorn" | ||
task shutdown: :environment do | ||
queue kill_unicorn('TERM') | ||
command kill_unicorn("TERM") | ||
end | ||
|
||
desc "Restart unicorn service" | ||
task restart: :environment do | ||
queue restart_unicorn | ||
command restart_unicorn | ||
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
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