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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '068cf557c3a44aece001366bcd147616d4e6aafc3db1f6941a7b0b79c3db6799'
4
- data.tar.gz: f73cdb06ddd54b2ea5b9744257172a196af3b34a4b08039580e4391e59959f67
3
+ metadata.gz: 7f35a469754d680757e756d963d51626b61036f72ded01624da7b83c265df270
4
+ data.tar.gz: 505a63cfb76e1f52e616ad8db6d2a61f4d1c414c2db1e2930f47678669b4efdc
5
5
  SHA512:
6
- metadata.gz: daf9793fd47e3c90114bf80c0d05fc07ca29e8ff8c28b017a86da6b1a37887492926c350b19f7fdc6e957642a87485c043e2e6f737fcb0117848335e5e6c6613
7
- data.tar.gz: 1d8bcbc7a6f7105196686f12a9cdde4ddfc0ee5f37fa75be96b79d1c3c9ba41db7c9a4a116ea5cf07a7a547b6e1a2a84e39fd124d57b6d3138e58f8843a87716
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:$apr1$i7hdbc9g$Rkocxo9snhmuESvUg0TTv/',
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
 
@@ -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].merge! @deploy[name] if @deploy[name]
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
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  class Stack
3
- VERSION = '0.0.71'
3
+ VERSION = '0.0.72'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.71
4
+ version: 0.0.72
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artyom B