capistrano3-unicorn-nginx 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b52c5d9a913f2c7d99c928d5a8aa432602378bba
|
4
|
+
data.tar.gz: '0804623ecb45c5d8dfe40bde11f9d559f1757261'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 518e991b941a0110f17c8e589cf307582b8fb43800734c687ef7a2ff48ab669624e48713e410cbb4334091e782851544911ae3d4e515fa4f8dc2d9a645dc0d65
|
7
|
+
data.tar.gz: 18116972c62d23818a0ae48b3a70bc368341e5d96ef05984bbfa13e3d1d574d9c6ef6cdd1b83c4a863e9d6b12fd13c524063f29507d9c4875fcbf911cb4cb402
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = 'capistrano3-unicorn-nginx'
|
7
|
-
s.version = '0.0.
|
7
|
+
s.version = '0.0.3'
|
8
8
|
s.date = '2019-02-01'
|
9
9
|
s.summary = "Capistrano tasks for automatic and sensible unicorn configuration"
|
10
10
|
s.description = <<-EOF.gsub(/^\s+/, '')
|
@@ -8,7 +8,7 @@ module Capistrano3
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def template_to_s template_name
|
11
|
-
config_file = File.join(File.dirname(__FILE__), "../../generators/
|
11
|
+
config_file = File.join(File.dirname(__FILE__), "../../generators/capistrano3/unicorn_nginx/templates/#{template_name}")
|
12
12
|
ERB.new(File.read(config_file), nil, '-').result(binding)
|
13
13
|
end
|
14
14
|
|
@@ -0,0 +1,36 @@
|
|
1
|
+
worker_processes <%= fetch(:unicorn_worker_processes) %>
|
2
|
+
timeout <%= fetch(:unicorn_timeout) %>
|
3
|
+
app_path = "<%= fetch(:deploy_to) %>"
|
4
|
+
listen "<%= fetch(:unicorn_sock_path) %>"
|
5
|
+
pid "<%= fetch(:unicorn_pid_path) %>"
|
6
|
+
|
7
|
+
stderr_path "<%= fetch(:unicorn_stderr_path) %>"
|
8
|
+
stdout_path "<%= fetch(:unicorn_stdout_path %>"
|
9
|
+
|
10
|
+
preload_app true
|
11
|
+
|
12
|
+
# use correct Gemfile on restarts
|
13
|
+
before_exec do |server|
|
14
|
+
ENV['BUNDLE_GEMFILE'] = "#{app_path}/current/Gemfile"
|
15
|
+
end
|
16
|
+
|
17
|
+
preload_app true
|
18
|
+
|
19
|
+
before_fork do |server, worker|
|
20
|
+
# the following is highly recomended for Rails + "preload_app true"
|
21
|
+
# as there's no need for the master process to hold a connection
|
22
|
+
if defined?(ActiveRecord::Base)
|
23
|
+
ActiveRecord::Base.connection.disconnect!
|
24
|
+
end
|
25
|
+
|
26
|
+
# Before forking, kill the master process that belongs to the .oldbin PID.
|
27
|
+
# This enables 0 downtime deploys.
|
28
|
+
old_pid = "#{server.config[:pid]}.oldbin"
|
29
|
+
if File.exists?(old_pid) && server.pid != old_pid
|
30
|
+
begin
|
31
|
+
Process.kill("QUIT", File.read(old_pid).to_i)
|
32
|
+
rescue Errno::ENOENT, Errno::ESRCH
|
33
|
+
# someone else did our job for us
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano3-unicorn-nginx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- truongkma
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- lib/capistrano3/tasks/unicorn.rake
|
71
71
|
- lib/capistrano3/unicorn_nginx.rb
|
72
72
|
- lib/capistrano3/unicorn_nginx/helpers.rb
|
73
|
+
- lib/generators/capistrano3/unicorn_nginx/templates/unicorn.rb.erb
|
73
74
|
homepage: https://github.com/truongkma/capistrano3-unicorn-nginx
|
74
75
|
licenses:
|
75
76
|
- MIT
|