dry-stack 0.0.71 → 0.0.72
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/stack.drs +6 -2
- data/lib/dry-stack/stack.rb +17 -1
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f35a469754d680757e756d963d51626b61036f72ded01624da7b83c265df270
|
4
|
+
data.tar.gz: 505a63cfb76e1f52e616ad8db6d2a61f4d1c414c2db1e2930f47678669b4efdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b31cdaa49ea775772f96b7975cf2948eefb0aa2889efa4177aae65f6932d376e433c1cb3c857f1090b6576fb373c6fb0c087eef5957009d808dcbab620eba563
|
7
|
+
data.tar.gz: 2f5840ec782285994e355950fe7d3fa856f275729351160999c973f81520867f41f35934c9636ae3f49efe4ed0207afc5ea9b34991e23fc24063e44e53bd0578
|
data/bin/stack.drs
CHANGED
@@ -2,15 +2,19 @@ Description <<~DSC
|
|
2
2
|
|
3
3
|
DSC
|
4
4
|
|
5
|
-
Options name: 'stack_name'
|
5
|
+
Options name: 'stack_name', traefik: true
|
6
6
|
SwarmDeploy :sky_gates do
|
7
7
|
context_host 'ssh://root@10.0.0.1'
|
8
8
|
stack_name 'remote_stack'
|
9
9
|
env REGISTRY_HOST: '10.100.0.2:5000'
|
10
10
|
end
|
11
|
+
Ingress admin: [
|
12
|
+
{host: 'backend.*'},
|
13
|
+
{host: 'admin.*', path: '/api', port: 4000}
|
14
|
+
]
|
11
15
|
|
12
16
|
Deploy [:admin, :operator], labels: [
|
13
|
-
'traefik.http.middlewares.%{service-name}_auth.basicauth.users=admin
|
17
|
+
'traefik.http.middlewares.%{service-name}_auth.basicauth.users=admin:$$apr1$$i7hdbc9g$$Rkocxo9snhmuESvUg0TTv/',
|
14
18
|
"traefik.http.routers.%{service-name}.middlewares=%{service-name}_auth"
|
15
19
|
]
|
16
20
|
|
data/lib/dry-stack/stack.rb
CHANGED
@@ -13,6 +13,22 @@ require 'digest'
|
|
13
13
|
# end
|
14
14
|
|
15
15
|
module Dry
|
16
|
+
class ::Hash
|
17
|
+
def deep_merge!(second)
|
18
|
+
merger = proc { |_, v1, v2|
|
19
|
+
if Hash === v1 && Hash === v2
|
20
|
+
v1.merge!(v2, &merger)
|
21
|
+
else
|
22
|
+
if Array === v1 && Array === v2
|
23
|
+
v1 | v2
|
24
|
+
else
|
25
|
+
[:undefined, nil, :nil].include?(v2) ? v1 : v2
|
26
|
+
end
|
27
|
+
end
|
28
|
+
}
|
29
|
+
merge!(second.to_h, &merger)
|
30
|
+
end
|
31
|
+
end
|
16
32
|
|
17
33
|
def each_recursive(parent, each_ =-> { _1.respond_to?(:each) ? _1.each : [] }, path = [], &blk)
|
18
34
|
each2_ = each_.is_a?(Array) ? ->(p) { (m = each_.find { p.respond_to? _1 }) ? p.send(m) : [] } : each_
|
@@ -182,7 +198,7 @@ module Dry
|
|
182
198
|
service[:environment].merge! STACK_NAME: @name.to_s, STACK_SERVICE_NAME: name.to_s
|
183
199
|
service[:environment].transform_values! { !!_1 == _1 ? _1.to_s : _1 } # (false|true) to string
|
184
200
|
|
185
|
-
service[:deploy].
|
201
|
+
service[:deploy].deep_merge! @deploy[name] if @deploy[name]
|
186
202
|
|
187
203
|
hash = {'service-name': service_name, 'stack-name': @name}
|
188
204
|
hash.default = ''
|
data/lib/version.rb
CHANGED