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.
- checksums.yaml +4 -4
- data/README.md +27 -6
- data/bin/aggconsul +3 -1
- data/bin/aggexec +1 -1
- data/bin/aggwait +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 330e0e63f8b3fb0f59ff1b3906cc34dbb7277d5c
|
4
|
+
data.tar.gz: a7f1657a0353c8ede9b8e53a85e785980b76645d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
###
|
12
|
+
### aggexec
|
13
13
|
|
14
|
-
|
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:
|
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
|
33
|
-
|
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:
|
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 =
|
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 =
|
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(':')
|