capistrano-nginx-unit 0.5.0 → 0.6.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 +4 -4
- data/README.md +2 -10
- data/lib/capistrano/nginx-unit/version.rb +1 -1
- data/lib/capistrano/tasks/nginx-unit.rake +10 -26
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddfee8b2122871c6fd75fca4facab14159e52deb451a886bce04171bafb8d25b
|
4
|
+
data.tar.gz: 168ab379cc00f7798cb96ee04913526e35d35950ff51f69d21729b74c32518d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7042401e81aed3c569c4899940fc73a438f6a2fad5a82fb2122d8df689549068cf569f4ab3277fd5bb8ee1eb9af4866d4805995dda587f4d83175e842a8a77fc
|
7
|
+
data.tar.gz: 263777e2596475d88f82eb64dec8cf4ee2499f82b56337cb43340e55b4940f341cdd06c20c7569c525701ae003b6c187364e9057e35014fef0c0102c64e87176
|
data/README.md
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
## Installation
|
4
4
|
|
5
5
|
```rb
|
6
|
+
# Gemfile
|
6
7
|
gem "capistrano-nginx-unit"
|
7
8
|
```
|
8
9
|
|
@@ -30,6 +31,7 @@ cap nginx_unit:stop # Stop NGINX Unit process
|
|
30
31
|
|
31
32
|
`nginx_unit:attach` is main task.
|
32
33
|
The task [sends HTTP request to configure NGINX Unit](http://unit.nginx.org/configuration/) on server.
|
34
|
+
When NGINX Unit process received the request, launches rack application process.
|
33
35
|
If you want to apply new code when deployed, please invoke `nginx_unit:attach` task after `deploy:published`.
|
34
36
|
|
35
37
|
```rb
|
@@ -41,9 +43,7 @@ after "deploy:published", "nginx_unit:attach"
|
|
41
43
|
|
42
44
|
```rb
|
43
45
|
set :nginx_unit_roles, -> { :app }
|
44
|
-
set :nginx_unit_pid, -> { "/var/run/unit.pid" }
|
45
46
|
set :nginx_unit_control_sock, -> { "/var/run/control.unit.sock" }
|
46
|
-
set :nginx_unit_options, -> { "" }
|
47
47
|
set :nginx_unit_listen, -> { "*:3000" }
|
48
48
|
set :nginx_unit_app_name, -> { fetch(:application) }
|
49
49
|
set :nginx_unit_processes, -> { nil }
|
@@ -57,18 +57,10 @@ set :nginx_unit_script, -> { "config.ru" }
|
|
57
57
|
|
58
58
|
Roles to run tasks for NGINX Unit. Default: `:app`
|
59
59
|
|
60
|
-
- `:nginx_unit_pid`
|
61
|
-
|
62
|
-
Path to NGINX Unit's pid file. Default: `"/var/run/unit.pid"`
|
63
|
-
|
64
60
|
- `:nginx_unit_control_sock`
|
65
61
|
|
66
62
|
Path to NGINX Unit's unix domain socket path. Default: `"/var/run/control.unit.sock"`
|
67
63
|
|
68
|
-
- `:nginx_unit_options`
|
69
|
-
|
70
|
-
Additional options that is used when launch NGINX Unit by `nginx_unit:start`
|
71
|
-
|
72
64
|
- `:nginx_unit_listen`
|
73
65
|
|
74
66
|
IP Address and port where rack application listens on. Default: `"*:3000"`
|
@@ -1,9 +1,7 @@
|
|
1
1
|
namespace :load do
|
2
2
|
task :defaults do
|
3
3
|
set :nginx_unit_roles, -> { :app }
|
4
|
-
set :nginx_unit_pid, -> { "/var/run/unit.pid" }
|
5
4
|
set :nginx_unit_control_sock, -> { "/var/run/control.unit.sock" }
|
6
|
-
set :nginx_unit_options, -> { "" }
|
7
5
|
set :nginx_unit_listen, -> { "*:3000" }
|
8
6
|
set :nginx_unit_app_name, -> { fetch(:application) }
|
9
7
|
set :nginx_unit_processes, -> { nil }
|
@@ -15,30 +13,16 @@ namespace :load do
|
|
15
13
|
end
|
16
14
|
|
17
15
|
namespace :nginx_unit do
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
fetch(:nginx_unit_options)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
# NOTE: Should we detach listener and application before killing?
|
34
|
-
desc "Stop NGINX Unit process"
|
35
|
-
task :stop do
|
36
|
-
on release_roles(fetch(:nginx_unit_roles)) do
|
37
|
-
pid_file = fetch(:nginx_unit_pid)
|
38
|
-
if test("[ -e #{pid_file} ] && kill -0 `cat #{pid_file}`")
|
39
|
-
execute :sudo, :kill, "-s QUIT `cat #{pid_file}`"
|
40
|
-
else
|
41
|
-
info "NGINX Unit is already stopped"
|
16
|
+
# NOTE: Should we detach listener and application before stopping?
|
17
|
+
[:start, :stop].each do |cmd|
|
18
|
+
desc "#{cmd.to_s.capitalize} NGINX Unit process"
|
19
|
+
task cmd do
|
20
|
+
on release_roles(fetch(:nginx_unit_roles)) do
|
21
|
+
if test(:which, :systemctl)
|
22
|
+
sudo :systemctl, cmd, :unit
|
23
|
+
else
|
24
|
+
sudo :service, :unit, cmd
|
25
|
+
end
|
42
26
|
end
|
43
27
|
end
|
44
28
|
end
|