capistrano-nginx-unit 0.4.1 → 0.4.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 +1 -0
- data/lib/capistrano/nginx-unit/version.rb +1 -1
- data/lib/capistrano/tasks/nginx-unit.rake +11 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d15ca9bb4c77d34dd558fe8556d66a294c1085863f1cb5d48587a9df9dd4741b
|
4
|
+
data.tar.gz: af473b82caba3ba16ac1069d11d1a083ce0925bd80a1b217db1e1775d7b384b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8521f8793e8a52cd59839891958ce6c2b23c8d37d61796d59b0655eea21099359a4a96f5b6bd74138d8cf7e14a96c6b00c4acc7a90c1fccdb60c792e67808d58
|
7
|
+
data.tar.gz: e1c1a9fa7ccf60b5a17232f3f9c647c1a8c962f19d0d53af854b85531ba86f72ebf9b11554acf4e9649ecd9b9d8992f8a26f18e16196fe8e1ad942e97c8d31b5
|
data/README.md
CHANGED
@@ -62,15 +62,15 @@ namespace :nginx_unit do
|
|
62
62
|
|
63
63
|
desc "Attach application configuration to NGINX Unit"
|
64
64
|
task :attach_app do
|
65
|
-
on release_roles(fetch(:nginx_unit_roles)) do
|
65
|
+
on release_roles(fetch(:nginx_unit_roles)) do
|
66
66
|
released_dir = capture(:readlink, "-f", current_path)
|
67
67
|
raise "Doesn't exist released dir: #{released_dir}" unless test("[ -d #{released_dir} ]")
|
68
68
|
|
69
69
|
app_json = JSON.generate({
|
70
70
|
type: "ruby",
|
71
71
|
processes: fetch(:nginx_unit_processes),
|
72
|
-
user: fetch(:nginx_unit_user) ||
|
73
|
-
group: fetch(:nginx_unit_group) ||
|
72
|
+
user: fetch(:nginx_unit_user) || host.user,
|
73
|
+
group: fetch(:nginx_unit_group) || host.user,
|
74
74
|
working_directory: fetch(:nginx_unit_working_dir),
|
75
75
|
script: File.join(released_dir, fetch(:nginx_unit_script))
|
76
76
|
}.compact)
|
@@ -114,7 +114,7 @@ namespace :nginx_unit do
|
|
114
114
|
# Send request to NGINX Unit control socket
|
115
115
|
def control_nginx_unit(method, path: "", json: nil)
|
116
116
|
args = [
|
117
|
-
"-
|
117
|
+
"-s",
|
118
118
|
"-X #{method.to_s.upcase}",
|
119
119
|
"--unix-socket #{fetch(:nginx_unit_control_sock)}",
|
120
120
|
"'http://localhost/#{path}'"
|
@@ -122,7 +122,13 @@ namespace :nginx_unit do
|
|
122
122
|
|
123
123
|
args << "-d '#{json}'" if json
|
124
124
|
|
125
|
-
|
125
|
+
res = JSON.parse(capture(:curl, *args))
|
126
|
+
if res["error"]
|
127
|
+
error res.inspect
|
128
|
+
raise "NGINX Unit: #{res["error"]}"
|
129
|
+
else
|
130
|
+
info res.inspect
|
131
|
+
end
|
126
132
|
end
|
127
133
|
|
128
134
|
# Get current configuration
|
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.
|
4
|
+
version: 0.4.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-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|