capistrano-nginx-unit 0.1 → 0.2
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 +40 -2
- data/capistrano-nginx-unit.gemspec +2 -0
- data/lib/capistrano/nginx-unit/version.rb +1 -1
- data/lib/capistrano/tasks/nginx-unit.rake +19 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62b0d922cb2c6e70e8027253e76fd5b9cb0be6fbfb25a8ee31ec5c12a14661a2
|
4
|
+
data.tar.gz: 939506d0e5896d0f6e0c9058a8953a900543ab533410d2ddb89888bc3607d995
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3992ecbc1b83746ec29ef21a65e511e252d1e1267f0ad9df70b2841b377367b16c4c9d8bdd7e01b14afd9e8984cea89eb9252aa50cced62bb913a809bbff766d
|
7
|
+
data.tar.gz: 3b4480dd832694971899c0a6f83cac055490a4aa62bbfa302bef2bae17d57457d97a66bae093ee7499a4749e2278f97184f0b224a83e913b0c5b280f1b677b77
|
data/README.md
CHANGED
@@ -2,8 +2,46 @@
|
|
2
2
|
|
3
3
|
## Installation
|
4
4
|
|
5
|
-
|
5
|
+
```rb
|
6
|
+
gem "capistrano-nginx-unit"
|
7
|
+
```
|
6
8
|
|
7
9
|
## Usage
|
8
10
|
|
9
|
-
|
11
|
+
Require in Capfile.
|
12
|
+
|
13
|
+
```rb
|
14
|
+
# Capfile
|
15
|
+
require "capistrano/nginx-unit"
|
16
|
+
```
|
17
|
+
|
18
|
+
Defined following tasks.
|
19
|
+
|
20
|
+
```
|
21
|
+
cap nginx_unit:configure # Set listener and application configuration for NGINX Unit
|
22
|
+
cap nginx_unit:configure_app # Set application configuration for NGINX Unit
|
23
|
+
cap nginx_unit:configure_listener # Set listener configuration for NGINX Unit
|
24
|
+
cap nginx_unit:start # Start NGINX Unit process
|
25
|
+
```
|
26
|
+
|
27
|
+
Defined following customizable options.
|
28
|
+
|
29
|
+
```rb
|
30
|
+
set :nginx_unit_roles, -> { :app }
|
31
|
+
set :nginx_unit_pid, -> { "/var/run/unit.pid" }
|
32
|
+
set :nginx_unit_control_sock, -> { "/var/run/control.unit.sock" }
|
33
|
+
set :nginx_unit_options, -> { "" }
|
34
|
+
set :nginx_unit_listen, -> { "*:3000" }
|
35
|
+
set :nginx_unit_app_name, -> { fetch(:application) }
|
36
|
+
set :nginx_unit_processes, -> { 1 }
|
37
|
+
set :nginx_unit_user, -> { nil }
|
38
|
+
set :nginx_unit_group, -> { nil }
|
39
|
+
set :nginx_unit_script, -> { "config.ru" }
|
40
|
+
```
|
41
|
+
|
42
|
+
If you want to apply new code when deployed, please invoke `nginx_unit:configure` task after `deploy:published`.
|
43
|
+
|
44
|
+
```rb
|
45
|
+
# deploy.rb
|
46
|
+
after "deploy:published", "nginx_unit:configure"
|
47
|
+
```
|
@@ -1,7 +1,9 @@
|
|
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" }
|
4
5
|
set :nginx_unit_control_sock, -> { "/var/run/control.unit.sock" }
|
6
|
+
set :nginx_unit_options, -> { "" }
|
5
7
|
set :nginx_unit_listen, -> { "*:3000" }
|
6
8
|
set :nginx_unit_app_name, -> { fetch(:application) }
|
7
9
|
set :nginx_unit_processes, -> { 1 }
|
@@ -11,12 +13,28 @@ namespace :load do
|
|
11
13
|
end
|
12
14
|
end
|
13
15
|
|
14
|
-
# TODO:
|
16
|
+
# TODO: Stop NGINX Unit process
|
15
17
|
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
|
+
|
16
33
|
# If you want to apply new code when deployed,
|
17
34
|
# please invoke this task after deploy:published
|
18
35
|
desc "Set listener and application configuration for NGINX Unit"
|
19
36
|
task :configure do
|
37
|
+
invoke "nginx_unit:start"
|
20
38
|
invoke "nginx_unit:configure_app"
|
21
39
|
invoke "nginx_unit:configure_listener"
|
22
40
|
end
|
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.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- murakmii
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -51,9 +51,9 @@ require_paths:
|
|
51
51
|
- lib
|
52
52
|
required_ruby_version: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- - "
|
54
|
+
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '0'
|
56
|
+
version: '2.0'
|
57
57
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|