capistrano-nginx-unit 0.8.0 → 0.9.0
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 +5 -5
- data/.gitignore +2 -0
- data/README.md +18 -4
- data/lib/capistrano/nginx-unit/version.rb +1 -1
- data/lib/capistrano/tasks/nginx-unit.rake +5 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bb9b313061e9ebe5acc0552f525561bdb8967df4
|
4
|
+
data.tar.gz: 861bf5143c2f2cc4f316cb0219f28f0d0d31f9f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75db8120290fc484d8c5462903db5280408addbc905cb9430f730490edfa803f92fcb2bf7933ac25cb9022540dfa4cfcf524d64c1deb62f478d85d6fe36565ea
|
7
|
+
data.tar.gz: 8df07306ce000f37bcf6d7fc39124290dbb17032f6e44199e67dd1e0ba6555131bcf62487a2130f1ad58e86f28e9102bb76190de00876c5b3d67d0b911ae215f
|
data/README.md
CHANGED
@@ -45,6 +45,7 @@ after "deploy:published", "nginx_unit:attach"
|
|
45
45
|
set :nginx_unit_roles, -> { :app }
|
46
46
|
set :nginx_unit_control_sock, -> { "/var/run/control.unit.sock" }
|
47
47
|
set :nginx_unit_listen, -> { "*:3000" }
|
48
|
+
set :nginx_unit_listener, -> { { pass: "applications/#{fetch(:nginx_unit_app_name)}" } }
|
48
49
|
set :nginx_unit_app_name, -> { fetch(:application) }
|
49
50
|
set :nginx_unit_processes, -> { nil }
|
50
51
|
set :nginx_unit_user, -> { nil }
|
@@ -52,6 +53,7 @@ set :nginx_unit_group, -> { nil }
|
|
52
53
|
set :nginx_unit_working_dir, -> { nil }
|
53
54
|
set :nginx_unit_script, -> { "config.ru" }
|
54
55
|
set :nginx_unit_environment, -> { {} }
|
56
|
+
set :nginx_unit_limits, -> { nil }
|
55
57
|
```
|
56
58
|
|
57
59
|
- `:nginx_unit_roles`
|
@@ -67,6 +69,13 @@ set :nginx_unit_environment, -> { {} }
|
|
67
69
|
IP Address and port where rack application listens on. Default: `"*:3000"`
|
68
70
|
See [Listeners configuration](https://unit.nginx.org/configuration/#listeners)
|
69
71
|
|
72
|
+
- `:nginx_unit_listener`
|
73
|
+
|
74
|
+
Listener configuration of rack application processes. Default: `{ pass: "applications/#{fetch(:nginx_unit_app_name)}" }`
|
75
|
+
If you are using Nginx UNIT that doesn\`t support `pass` option, you can overwrite this configuration with `{ application: fetch(:nginx_unit_app_name) }`
|
76
|
+
(However, `application` option is currently deprecated.)
|
77
|
+
See [Listeners configuration](https://unit.nginx.org/configuration/#listeners)
|
78
|
+
|
70
79
|
- `:nginx_unit_app_name`
|
71
80
|
|
72
81
|
Application name.
|
@@ -75,10 +84,10 @@ set :nginx_unit_environment, -> { {} }
|
|
75
84
|
- `:nginx_unit_processes`
|
76
85
|
|
77
86
|
Number of rack application processes. Default: `1`
|
78
|
-
|
87
|
+
You can also set the `Hash` that has keys `max`, `spare` and `idle_timeout`.
|
88
|
+
See [Processes and Limits](https://unit.nginx.org/configuration/#processes-and-limits)
|
79
89
|
|
80
|
-
- `:nginx_unit_user`
|
81
|
-
- `:nginx_unit_group`
|
90
|
+
- `:nginx_unit_user`, `:nginx_unit_group`
|
82
91
|
|
83
92
|
Username and group of rack application process. Default: `"nobody"`
|
84
93
|
See [Application Object configuration](https://unit.nginx.org/configuration/#application-objects)
|
@@ -97,4 +106,9 @@ set :nginx_unit_environment, -> { {} }
|
|
97
106
|
|
98
107
|
Environment variable setting. Default value is empty.
|
99
108
|
This variable accepts `Hash`. e.g., `{ "RAILS_ENV" => "production" }`.
|
100
|
-
|
109
|
+
|
110
|
+
- `:nginx_unit_limits`
|
111
|
+
|
112
|
+
Request limits of rack application processes. Default: `nil`(not specified)
|
113
|
+
You can set the `Hash` that has keys `requests` and `timeout`.
|
114
|
+
See [Processes and Limits](https://unit.nginx.org/configuration/#processes-and-limits)
|
@@ -3,6 +3,7 @@ namespace :load do
|
|
3
3
|
set :nginx_unit_roles, -> { :app }
|
4
4
|
set :nginx_unit_control_sock, -> { "/var/run/control.unit.sock" }
|
5
5
|
set :nginx_unit_listen, -> { "*:3000" }
|
6
|
+
set :nginx_unit_listener, -> { { pass: "applications/#{fetch(:nginx_unit_app_name)}" } }
|
6
7
|
set :nginx_unit_app_name, -> { fetch(:application) }
|
7
8
|
set :nginx_unit_processes, -> { nil }
|
8
9
|
set :nginx_unit_user, -> { nil }
|
@@ -10,6 +11,7 @@ namespace :load do
|
|
10
11
|
set :nginx_unit_working_dir, -> { nil }
|
11
12
|
set :nginx_unit_script, -> { "config.ru" }
|
12
13
|
set :nginx_unit_environment, -> { {} }
|
14
|
+
set :nginx_unit_limits, -> { nil }
|
13
15
|
end
|
14
16
|
end
|
15
17
|
|
@@ -40,7 +42,7 @@ namespace :nginx_unit do
|
|
40
42
|
desc "Attach listener configuration to NGINX Unit"
|
41
43
|
task :attach_listener do
|
42
44
|
on release_roles(fetch(:nginx_unit_roles)) do
|
43
|
-
listener_json = JSON.generate(
|
45
|
+
listener_json = JSON.generate(fetch(:nginx_unit_listener))
|
44
46
|
control_nginx_unit(:put, path: "/listeners/#{fetch(:nginx_unit_listen)}", json: listener_json)
|
45
47
|
end
|
46
48
|
end
|
@@ -58,7 +60,8 @@ namespace :nginx_unit do
|
|
58
60
|
group: fetch(:nginx_unit_group),
|
59
61
|
working_directory: fetch(:nginx_unit_working_dir) || released_dir,
|
60
62
|
script: File.join(released_dir, fetch(:nginx_unit_script)),
|
61
|
-
environment: fetch(:nginx_unit_environment)
|
63
|
+
environment: fetch(:nginx_unit_environment),
|
64
|
+
limits: fetch(:nginx_unit_limits),
|
62
65
|
}.reject { |_, v| v.respond_to?(:empty?) ? v.empty? : v.nil? })
|
63
66
|
|
64
67
|
control_nginx_unit(:put, path: "/applications/#{fetch(:nginx_unit_app_name)}", json: app_json)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-nginx-unit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- murakmii
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
62
|
version: '0'
|
63
63
|
requirements: []
|
64
64
|
rubyforge_project:
|
65
|
-
rubygems_version: 2.
|
65
|
+
rubygems_version: 2.5.2.3
|
66
66
|
signing_key:
|
67
67
|
specification_version: 4
|
68
68
|
summary: The Capistrano 3.x task to run rack application on NGINX Unit
|