aggkit 0.4.4.12292 → 0.4.4.12293

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -6
  3. data/bin/aggconsul +3 -1
  4. data/bin/aggexec +1 -1
  5. data/bin/aggwait +3 -1
  6. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7e60deba3fa62e58fca16ad17c510ad79184ac9
4
- data.tar.gz: 52b36d4af259d772575b8b1f869b3ddc02ef7178
3
+ metadata.gz: 330e0e63f8b3fb0f59ff1b3906cc34dbb7277d5c
4
+ data.tar.gz: a7f1657a0353c8ede9b8e53a85e785980b76645d
5
5
  SHA512:
6
- metadata.gz: 543131a585b51005c7d40c31825f0bbfed6ae5e17903510bcc1afdd85f907f51cf84f3a9fa81be9a77f0035da019ff545119f17e3fe269ae86b3f29ba9fe3a74
7
- data.tar.gz: 7404283ebc889e58b061dcf0179d6a9cfec1da120cf00214f59e4c8d817737cdbe78ae6e1e47e4588f7df20845d0a59362b0379b057314bd3109faffbb905b3e
6
+ metadata.gz: 3117d8862c4e4cf7928a396dccd4773fd0cea712f60c6a3c0284d4cc06d1bc7ec31ad20689a433ffb556dff531c7d426d5e43dcf5f99b6cb1d54f0d796202e81
7
+ data.tar.gz: 4700b1dd3be7e1eee5356acbb744910b3839598bc8df57383bc17e506923950788021ecf333995b6cae48ab6ea164cd01aa8311918309148ba6dad776dc06d2c
data/README.md CHANGED
@@ -9,9 +9,28 @@ Helper tools for work with docker and consul
9
9
 
10
10
  Some useful scripts to run inside or outside container
11
11
 
12
- ### waiter.rb
12
+ ### aggexec
13
13
 
14
- waiter.rb allows to wait many conditions:
14
+ aggexec to start process in context of consul:
15
+
16
+ * load environment variables from Consul KV
17
+ * preprocess template files with loaded environment variables
18
+ * wait for healty status of consul services
19
+
20
+ ```
21
+ Usage: aggexec [options] -- exec
22
+ --consul=http://localhost:8500
23
+ Set consul http address. CONSUL_HTTP_ADDR env can be used instead
24
+ --depends=mq,db,router... Set list of services to wait for ready before start
25
+ --prefix=kv/folder/path Consul KV prefix to load envs from. Multiple prefixes are merged from left to right.
26
+ --service=<SERVICE> Showrtcut for --prefix=services/env/<SERVICE>. Multiple prefixes are merged from left to right.
27
+ --templates=<FOLDER> Folder for recursive ensubst *.in templates. Multiple prefixes are merged from left to right.
28
+ ```
29
+
30
+
31
+ ### aggwait
32
+
33
+ aggwait allows to wait many conditions:
15
34
 
16
35
  * tcp port opening
17
36
  * PostgreSQL database creation
@@ -20,7 +39,7 @@ waiter.rb allows to wait many conditions:
20
39
  * healthy Consul service
21
40
 
22
41
  ```
23
- Usage: waiter.rb [options] -- exec
42
+ Usage: aggwait [options] -- exec
24
43
  --tcp host:port Wait for tcp accepts on host:port
25
44
  --db dbname Wait for PG database exists. Using --tcp to conenct PG
26
45
  --tb tablename Wait for PG table exists. Using --tcp to conenct PG
@@ -29,10 +48,12 @@ Usage: waiter.rb [options] -- exec
29
48
  HTTP addres to connect to consul
30
49
  --consul Wait for local consul agent to be ready
31
50
  --consul-service service Wait for service appear in consul
32
- --consul-service-count count Wait for this count services appear in consul
33
- --consul-tag tag User tag to filter services in consul
51
+ --consul-service-count count=1
52
+ Wait for this count of service appear in consul
53
+ --consul-tag tag Filter consul service by tag
34
54
  --user user username
35
55
  --pass pass password
56
+ --docker=SOCKET wait for docker available
36
57
  -t, --timeout secs=15 Total timeout
37
58
  -i, --interval secs=2 Interval between attempts
38
59
  -q, --quiet Do not output any status messages
@@ -49,7 +70,7 @@ Helper to use Consul in 12Factor application. Inspired by https://github.com/has
49
70
  * read files and store it in Consul key/value store
50
71
 
51
72
  ```
52
- Usage: consul.rb [options] -- exec
73
+ Usage: aggconsul [options] -- exec
53
74
  --consul url Set up a custom Consul URL
54
75
  --token token Connect into consul with custom access token (ACL)
55
76
  --init [service] Initialize Consul services from config
data/bin/aggconsul CHANGED
@@ -16,6 +16,8 @@ end
16
16
  consul: ENV['CONSUL_HTTP_ADDR']
17
17
  }
18
18
 
19
+ UTIL = File.basename(__FILE__)
20
+
19
21
  @opts[:exec] = (begin
20
22
  ARGV.join(' ').split(' -- ')[1].strip
21
23
  rescue StandardError
@@ -23,7 +25,7 @@ end
23
25
  end)
24
26
 
25
27
  parser = OptionParser.new do |o|
26
- o.banner = 'Usage: consul.rb [options] -- exec'
28
+ o.banner = "Usage: #{UTIL} [options] -- exec"
27
29
 
28
30
  o.on('--consul url', 'Set up a custom Consul URL') do |consul|
29
31
  ENV['CONSUL_HTTP_ADDR'] = if consul.to_s['http']
data/bin/aggexec CHANGED
@@ -23,7 +23,7 @@ end
23
23
  end)
24
24
 
25
25
  parser = Aggkit::OptionParser.new do |o|
26
- o.banner = "Usage: #{UTIL} [options]"
26
+ o.banner = "Usage: #{UTIL} [options] -- exec"
27
27
 
28
28
  o.on("--consul=#{@opts[:consul]}", 'Set consul http address. CONSUL_HTTP_ADDR env can be used instead') do |consul|
29
29
  ENV['CONSUL_HTTP_ADDR'] = Aggkit::Consul.consul_addr(consul)
data/bin/aggwait CHANGED
@@ -15,6 +15,8 @@ INTERVAL = 3
15
15
 
16
16
  @opts = {}
17
17
 
18
+ UTIL = File.basename(__FILE__)
19
+
18
20
  if ENV['CONSUL_HTTP_ADDR'].to_s.empty?
19
21
  ENV['CONSUL_HTTP_ADDR'] = "http://#{ENV['CONSUL_HOST'] || 'localhost'}:8500"
20
22
  end
@@ -31,7 +33,7 @@ end
31
33
 
32
34
 
33
35
  OptionParser.new do |o|
34
- o.banner = 'Usage: waiter.rb [options] -- exec'
36
+ o.banner = "Usage: #{UTIL} [options] -- exec"
35
37
 
36
38
  o.on('--tcp host:port', 'Wait for tcp accepts on host:port') do |addr|
37
39
  host, port = addr.split(':')
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.12292
4
+ version: 0.4.4.12293
5
5
  platform: ruby
6
6
  authors:
7
7
  - Godko Ivan