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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd3c4a03da68b7bc0106eadaa2805e2a2290467ddd385d59c9e5c2778a712ee5
4
- data.tar.gz: 8641defe25fbfde3e6803ba8a4646014929d233729dba22063c3dedb22c270dd
3
+ metadata.gz: d15ca9bb4c77d34dd558fe8556d66a294c1085863f1cb5d48587a9df9dd4741b
4
+ data.tar.gz: af473b82caba3ba16ac1069d11d1a083ce0925bd80a1b217db1e1775d7b384b3
5
5
  SHA512:
6
- metadata.gz: d39cb5e79c192e6141a5e58f98d8a59a143140e70dfa0abe6cfb4fb9760ec25a5193f4c3e8675c45e992c275451b25401022e2f9679e310109cb0cd168cf547b
7
- data.tar.gz: dcdf18f6804bd871bd7ce9e8ff213f1a0df975123466d6b28f78cf2f3e15f76fec10ae6bd82d6bc311d653f3820f2c656924e0e80ff531a320fb79607e23e9ee
6
+ metadata.gz: 8521f8793e8a52cd59839891958ce6c2b23c8d37d61796d59b0655eea21099359a4a96f5b6bd74138d8cf7e14a96c6b00c4acc7a90c1fccdb60c792e67808d58
7
+ data.tar.gz: e1c1a9fa7ccf60b5a17232f3f9c647c1a8c962f19d0d53af854b85531ba86f72ebf9b11554acf4e9649ecd9b9d8992f8a26f18e16196fe8e1ad942e97c8d31b5
data/README.md CHANGED
@@ -49,5 +49,6 @@ set :nginx_unit_app_name, -> { fetch(:application) }
49
49
  set :nginx_unit_processes, -> { 1 }
50
50
  set :nginx_unit_user, -> { nil }
51
51
  set :nginx_unit_group, -> { nil }
52
+ set :nginx_unit_working_dir, -> { nil }
52
53
  set :nginx_unit_script, -> { "config.ru" }
53
54
  ```
@@ -1,3 +1,3 @@
1
1
  module Capistrano
2
- NGINX_UNIT_VERSION = "0.4.1"
2
+ NGINX_UNIT_VERSION = "0.4.2"
3
3
  end
@@ -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 |role|
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) || role.user,
73
- group: fetch(:nginx_unit_group) || role.user,
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
- "-fs",
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
- execute :curl, *args
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.1
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-10 00:00:00.000000000 Z
11
+ date: 2018-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano