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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ed82788ed0ec64329b59d74eb0f4e0d49bedca7387f004c46b2ca7a4e0b46d9
4
- data.tar.gz: fddbb7b8f49ef7a380e6f06bc996102f923d8f2dbacbe17f8345f2a6e63b0722
3
+ metadata.gz: ddfee8b2122871c6fd75fca4facab14159e52deb451a886bce04171bafb8d25b
4
+ data.tar.gz: 168ab379cc00f7798cb96ee04913526e35d35950ff51f69d21729b74c32518d6
5
5
  SHA512:
6
- metadata.gz: c6b4ce5212be304463bf8f5d8bad709461626e47e6bef5732ed688167f485826bfeedf973f1b8e9a3c0b85f4e774edccfb9ecdc84d9d19b893fd2dac40a5a004
7
- data.tar.gz: 2d30f7a0c1b098270d7b66c8c0d6678040de3736b4881322405c684805026c07b656795473d458ebe5afe3ed0efa6c51415feaee2bb1c9b3a7e03d89d169dc9c
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,3 +1,3 @@
1
1
  module Capistrano
2
- NGINX_UNIT_VERSION = "0.5.0"
2
+ NGINX_UNIT_VERSION = "0.6.0"
3
3
  end
@@ -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
- desc "Start NGINX Unit process"
19
- task :start do
20
- on release_roles(fetch(:nginx_unit_roles)) do
21
- pid_file = fetch(:nginx_unit_pid)
22
- if test("[ -e #{pid_file} ] && kill -0 `cat #{pid_file}`")
23
- info "NGINX Unit is already started"
24
- else
25
- execute :sudo, :unitd,
26
- "--pid #{pid_file}",
27
- "--control unix:#{fetch(:nginx_unit_control_sock)}",
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-nginx-unit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - murakmii