docker_toolkit 0.1.16 → 0.1.17
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/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/bin/waiter.rb +8 -3
- data/lib/docker_toolkit/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: 8c4b61f2f778550a54b6624e8cf0ca452dbbcdc9ef5898d1f1d1ff613f3d35b0
|
4
|
+
data.tar.gz: c88fcd9cca74e20499d497a98f1642c4d70675d7bad603ae46d847f236784ec5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbba6fd41edf1c4b9139cd2d41ce0da4576dc4dda28f04352d18c39797426751af59f6a4bcce8498df0bbacc87703f6e1b95c6634fd43d77505268762945790c
|
7
|
+
data.tar.gz: cbe40ccf9cf5c8a05602db56f47291bd65030ad8f3592723415c5ce1caca2f03691579fb47c2268b0aeefed0eb0ad67b2472ee568cf652d8322fe476b006cb1a
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -27,6 +27,7 @@ Usage: waiter.rb [options] -- exec
|
|
27
27
|
HTTP addres to connect to consul
|
28
28
|
--consul Wait for local consul agent to be ready
|
29
29
|
--consul-service service Wait for service appear in consul
|
30
|
+
--consul-service-count count Wait for this count services appear in consul
|
30
31
|
--user user username
|
31
32
|
--pass pass password
|
32
33
|
-t, --timeout secs=15 Total timeout
|
data/bin/waiter.rb
CHANGED
@@ -22,6 +22,7 @@ INTERVAL = 3
|
|
22
22
|
@opts[:timeout] = TIMEOUT
|
23
23
|
@opts[:interval] = INTERVAL
|
24
24
|
@opts[:consul_addr] = 'http://localhost:8500'
|
25
|
+
@opts[:consul_service_count] = 1
|
25
26
|
|
26
27
|
|
27
28
|
OptionParser.new do |o|
|
@@ -58,6 +59,10 @@ OptionParser.new do |o|
|
|
58
59
|
@opts[:consul_service] = service
|
59
60
|
end
|
60
61
|
|
62
|
+
o.on("--consul-service-count count=#{@opts[:consul_service_count]}", 'Wait for this count of service appear in consul') do |count|
|
63
|
+
@opts[:consul_service_count] = count.to_i
|
64
|
+
end
|
65
|
+
|
61
66
|
o.on('--user user', 'username') do |user|
|
62
67
|
@opts[:user] = user.strip
|
63
68
|
end
|
@@ -143,9 +148,9 @@ end
|
|
143
148
|
def wait_for_consul_service(service)
|
144
149
|
log("Waiting for consul service #{service}...")
|
145
150
|
ret = wait_for @opts[:timeout] do
|
146
|
-
cmd = "curl -s #{@opts[:consul_addr]}/v1/health/service/#{service}?passing
|
147
|
-
|
148
|
-
|
151
|
+
cmd = "curl -s #{@opts[:consul_addr]}/v1/health/service/#{service}?passing"
|
152
|
+
result = JSON.parse(`#{cmd}`) rescue []
|
153
|
+
result.count >= @opts[:consul_service_count]
|
149
154
|
end
|
150
155
|
|
151
156
|
yield(ret)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docker_toolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17
|
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: 2018-08-
|
12
|
+
date: 2018-08-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: diplomat
|