3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/capistrano-unicorn/config.rb', line 3
def self.load(config)
config.instance_eval do
_cset(:unicorn_env) { fetch(:rails_env, 'production' ) }
_cset(:unicorn_rack_env) do
fetch(:rails_env) == 'development' ? 'development' : 'deployment'
end
_cset(:unicorn_user) { nil }
_cset(:unicorn_bundle) { fetch(:bundle_cmd, "bundle") }
_cset(:unicorn_bin) { "unicorn" }
_cset(:unicorn_options) { '' }
_cset(:unicorn_restart_sleep_time) { 2 }
_cset(:app_subdir) { '' }
_cset(:unicorn_config_rel_path) { "config" }
_cset(:unicorn_config_filename) { "unicorn.rb" }
_cset(:unicorn_config_rel_file_path) \
{ unicorn_config_rel_path + '/' + unicorn_config_filename }
_cset(:unicorn_config_stage_rel_file_path) \
{ [ unicorn_config_rel_path, 'unicorn',
"#{unicorn_env}.rb" ].join('/') }
_cset(:app_path) { current_path + app_subdir }
_cset(:bundle_gemfile) { app_path + '/Gemfile' }
_cset(:unicorn_config_path) { app_path + '/' + unicorn_config_rel_path }
_cset(:unicorn_config_file_path) { app_path + '/' + unicorn_config_rel_file_path }
_cset(:unicorn_config_stage_file_path) \
{ app_path + '/' + unicorn_config_stage_rel_file_path }
_cset(:unicorn_default_pid) { app_path + "/tmp/pids/unicorn.pid" }
_cset(:unicorn_pid) do
=
if
else
logger.important "err :: failed to auto-detect pid from #{local_unicorn_config}"
logger.important "err :: falling back to default: #{unicorn_default_pid}"
unicorn_default_pid
end
end
end
end
|