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 +4 -4
- data/Gemfile.lock +2 -2
- data/bin/aggexec +1 -1
- data/bin/aggwait +16 -7
- data/lib/aggkit/version.rb +1 -1
- 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: b657b5dea23eb5fbff2e12ee3b2cc60b6b38fd08c8dacd0228617f686e43ed32
|
4
|
+
data.tar.gz: 372f667ba11d9eca4a6f99384d740a8d873e5d2b9a50929387dffe803a1f599d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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(
|
175
|
-
|
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
|
-
|
178
|
-
cmd
|
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)
|
data/lib/aggkit/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2019-11-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: diplomat
|