docker_toolkit 0.1.17 → 0.1.18

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: 8c4b61f2f778550a54b6624e8cf0ca452dbbcdc9ef5898d1f1d1ff613f3d35b0
4
- data.tar.gz: c88fcd9cca74e20499d497a98f1642c4d70675d7bad603ae46d847f236784ec5
3
+ metadata.gz: 2e506b5bda30e8b2af3f83b98321384feb54f23008546802c67fc20fecdb19cb
4
+ data.tar.gz: 13628761544fbccbb6fc59ef47ba8e06730f2020913dd341cf380d52c59bbdee
5
5
  SHA512:
6
- metadata.gz: cbba6fd41edf1c4b9139cd2d41ce0da4576dc4dda28f04352d18c39797426751af59f6a4bcce8498df0bbacc87703f6e1b95c6634fd43d77505268762945790c
7
- data.tar.gz: cbe40ccf9cf5c8a05602db56f47291bd65030ad8f3592723415c5ce1caca2f03691579fb47c2268b0aeefed0eb0ad67b2472ee568cf652d8322fe476b006cb1a
6
+ metadata.gz: fadbd3a24e4280cf5c347574dd711b85f4701a2a6c687caf9310b6039890488b7b6e2fed065e0ee18b972c8c3358930b3e6006b72ba71b86ec573a7578a7900a
7
+ data.tar.gz: '09b7f73b9f6842b5e3b57532f732c75a71e22d18e05ee33f23ae5338102ca7a077b0eb95dcc9498c0534e7ca4ec1652c75ba6a00b7019910e282788204f5b2d2'
data/README.md CHANGED
@@ -27,7 +27,8 @@ 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
+ --consul-service-count count Wait for this count services appear in consul
31
+ --consul-tag tag User tag to filter services in consul
31
32
  --user user username
32
33
  --pass pass password
33
34
  -t, --timeout secs=15 Total timeout
data/bin/waiter.rb CHANGED
@@ -5,6 +5,7 @@ require 'securerandom'
5
5
  require 'English'
6
6
  require 'openssl'
7
7
  require 'tempfile'
8
+ require 'json'
8
9
 
9
10
  STDOUT.sync = true
10
11
  STDERR.sync = true
@@ -63,6 +64,10 @@ OptionParser.new do |o|
63
64
  @opts[:consul_service_count] = count.to_i
64
65
  end
65
66
 
67
+ o.on("--consul-tag tag", 'Filter consul service by tag') do |tag|
68
+ @opts[:consul_tag] = tag.to_s
69
+ end
70
+
66
71
  o.on('--user user', 'username') do |user|
67
72
  @opts[:user] = user.strip
68
73
  end
@@ -149,7 +154,9 @@ def wait_for_consul_service(service)
149
154
  log("Waiting for consul service #{service}...")
150
155
  ret = wait_for @opts[:timeout] do
151
156
  cmd = "curl -s #{@opts[:consul_addr]}/v1/health/service/#{service}?passing"
152
- result = JSON.parse(`#{cmd}`) rescue []
157
+ cmd += "&tag=#{@opts[:consul_tag]}" if @opts[:consul_tag]
158
+ result = `#{cmd}`
159
+ result = JSON.parse(result) rescue []
153
160
  result.count >= @opts[:consul_service_count]
154
161
  end
155
162
 
@@ -1,5 +1,5 @@
1
1
  module DockerToolkit
2
2
 
3
- VERSION = '0.1.17'.freeze
3
+ VERSION = '0.1.18'.freeze
4
4
 
5
5
  end
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.17
4
+ version: 0.1.18
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-21 00:00:00.000000000 Z
12
+ date: 2018-08-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: diplomat