aggkit 0.4.8.19806 → 0.4.9.19910

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0746cb8e1d46fa1f4becb1caf02210127697d40bc245aa2f5292933cddaf4352
4
- data.tar.gz: a29ab236147f39ebdc47d1fef0a243b2edcd7a4016bd06566106c3e99e994470
3
+ metadata.gz: b657b5dea23eb5fbff2e12ee3b2cc60b6b38fd08c8dacd0228617f686e43ed32
4
+ data.tar.gz: 372f667ba11d9eca4a6f99384d740a8d873e5d2b9a50929387dffe803a1f599d
5
5
  SHA512:
6
- metadata.gz: b5981c2c7d7706cd39c24060bef5e6caf24faafe53f3265da97d8c003e2141241295b3c8e7eaad5d1f6072fb94fe6821b8cbfd810a3cbfe49ab904e6043a4b37
7
- data.tar.gz: a5d83805be2b6fe4ac18f6ae9276a008590f4fc2bf6f91016d7613c0e01ae45f430c3bec6b3dda49966a163409bfc495d7fbe0afeabdd56fb11b29bea4905bcf
6
+ metadata.gz: 445208a0a5b4f92701cbca89ce00d34be699abf292fe76242ec4039297d73841585c9eb4085d91c943af501a61e52f00f5758eb3b23e69beb3586e11f59f4a1e
7
+ data.tar.gz: b1489233760caea865521f3af563a5201461cf5b6c67fa164ddd6f77bd04589f6d43a21758b49215d686c74d5329a8f78ef646d10986d33a84b2d56d8f4bc8ee
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aggkit (0.4.8.19806)
4
+ aggkit (0.4.9.19910)
5
5
  diplomat
6
6
  dotenv
7
7
  json
@@ -19,7 +19,7 @@ GEM
19
19
  faraday (~> 0.9)
20
20
  docile (1.3.1)
21
21
  dotenv (2.7.5)
22
- faraday (0.17.0)
22
+ faraday (0.17.1)
23
23
  multipart-post (>= 1.2, < 3)
24
24
  json (2.2.0)
25
25
  multipart-post (2.1.1)
data/bin/aggexec CHANGED
@@ -36,7 +36,7 @@ parser = Aggkit::OptionParser.new do |o|
36
36
  @opts[:consul_port] = port.to_s.strip
37
37
  end
38
38
 
39
- o.on('--depends=mq,db,router...', 'Set list of services to wait for ready before start') do |list|
39
+ o.on('--depends=mq,db,router...', 'Set list of services to wait for ready before start. Service can be [<tag>@]<service> form') do |list|
40
40
  @opts[:depends] += list.to_s.split(/[ ;,|]/).map(&:to_s).reject(&:empty?)
41
41
  end
42
42
 
data/bin/aggwait CHANGED
@@ -68,15 +68,15 @@ OptionParser.new do |o|
68
68
  @opts[:consul] = true
69
69
  end
70
70
 
71
- o.on('--consul-service service', 'Wait for service appear in consul') do |service|
72
- @opts[:consul_service] = service
71
+ o.on('--consul-service service', 'Wait for service appear in consul. can be [<tag>@]<service>') do |service|
72
+ @opts[:consul_service] = service.strip
73
73
  end
74
74
 
75
75
  o.on("--consul-service-count count=#{@opts[:consul_service_count]}", 'Wait for this count of service appear in consul') do |count|
76
76
  @opts[:consul_service_count] = count.to_i
77
77
  end
78
78
 
79
- o.on('--consul-tag tag', 'Filter consul service by tag') do |tag|
79
+ o.on('--consul-tag tag', 'DEPRECATED. Filter consul service by tag') do |tag|
80
80
  @opts[:consul_tag] = tag.to_s
81
81
  end
82
82
 
@@ -171,11 +171,20 @@ def wait_for_consul
171
171
  yield(ret)
172
172
  end
173
173
 
174
- def wait_for_consul_service(service)
175
- log("Waiting for consul service #{service}...")
174
+ def wait_for_consul_service(tag_with_service)
175
+ tag, service = tag_with_service.split('@')
176
+ if service.nil?
177
+ service = tag
178
+ tag = nil
179
+ end
180
+
181
+ tag ||= @opts[:consul_tag]
182
+
183
+ log("Waiting for consul service #{service}#{tag ? " with tag #{tag}" : ''}...")
176
184
  ret = wait_for @opts[:timeout] do
177
- cmd = "curl -s #{@opts[:consul_addr]}/v1/health/service/#{service}?passing"
178
- cmd += "&tag=#{@opts[:consul_tag]}" if @opts[:consul_tag]
185
+ tag_query = tag ? "&tag=#{tag}" : ''
186
+ cmd = "curl -s \"#{@opts[:consul_addr]}/v1/health/service/#{service}?passing#{tag_query}\""
187
+
179
188
  result = `#{cmd}`
180
189
  result = begin
181
190
  JSON.parse(result)
@@ -1,6 +1,6 @@
1
1
  module Aggkit
2
2
 
3
- VERSION = '0.4.8'.freeze
3
+ VERSION = '0.4.9'.freeze
4
4
 
5
5
  end
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aggkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.8.19806
4
+ version: 0.4.9.19910
5
5
  platform: ruby
6
6
  authors:
7
7
  - Godko Ivan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-11-27 00:00:00.000000000 Z
12
+ date: 2019-11-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: diplomat