dry-stack 0.0.83 → 0.0.84

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: 699b765bc2706a898f06c1ba3409d93723584e567865f9b21800a2f800700dad
4
- data.tar.gz: 3a2ed784ad03723d09a19686a8f0204987a15876676e117596bbc5b24fa78419
3
+ metadata.gz: c0bd1b1e2e584eb1d7e95a2c56999710d82e0c9364eee5962b52c2897df10192
4
+ data.tar.gz: c0ddbe4c8df56f263fe7c9e74a9df399ac326e434ab876c95af8c507182c903b
5
5
  SHA512:
6
- metadata.gz: 3f98d9d33f3cdc6616e484f62ba41026c1e88cdbb7d19095087412ba3bb788d5841d166f2a3a4874561eaf0a0c13303609a6abeef479d8852d855bb694162d76
7
- data.tar.gz: 3fbd781699888422c806330c0bf3036e16a78017911bff5d46383b07834d7b6560d4b02073ce29c6813b4c841acf7689cd00dba89fdf555dd00f97ece7b26629
6
+ metadata.gz: b0baaa4ac39ea9aedf328cea616ee84ae529aaf059c3ea14e1074bdb6442dd3d7b1efe538ea4bea3df9e0a2c33e6dd8bfbffe0e732549290fe2a2b6e346e17e3
7
+ data.tar.gz: 8b6ca11354cef5eab3f85f8ebcb4b20a31180911bcf064d1fd10469a3fb12a585daa045e7d6c1215ac9a057ce8602730ab1c7465bb4747469d683a5d69579636
@@ -58,6 +58,7 @@ module Dry
58
58
  def user(user) = @service[:user] = user # "${UID}:${GID}", "www-data:www-data"
59
59
  def network(names) = (@service[:networks] ||= []) << names
60
60
  def basic_auth(user_and_password) = @service[:basic_auth] = user_and_password
61
+ def ingress(ing) = ((@service[:ingress] ||=[]) << ing).flatten!
61
62
  end
62
63
 
63
64
  class SwarmFunction
@@ -144,7 +145,9 @@ module Dry
144
145
  end
145
146
 
146
147
  compose[:services].each do |name, service|
147
- ingress = [@ingress[name]].flatten.compact
148
+
149
+ ingress = [@ingress[name], service[:ingress] || [] ].flatten.compact
150
+
148
151
  service[:deploy] ||= {}
149
152
  service[:deploy][:labels] ||= []
150
153
  service[:deploy][:labels] += @labels.map { "#{_1}=#{_2}" }
@@ -169,6 +172,7 @@ module Dry
169
172
  ingress[0][:port] ||= service[:ports]&.first
170
173
 
171
174
  ingress.each_with_index do |ing, index|
175
+
172
176
  if service[:basic_auth]
173
177
  ba_user, ba_password, salt = service[:basic_auth].split ':'
174
178
  hashed_password = apr1_crypt ba_password, (salt || rand(36**8).to_s(36))
@@ -210,6 +214,7 @@ module Dry
210
214
  end
211
215
  end
212
216
  service.delete :basic_auth
217
+ service.delete :ingress
213
218
 
214
219
  service[:environment] = @environment[name].merge(service[:environment]) if @environment[name]
215
220
  service[:environment].merge! STACK_NAME: @name.to_s, STACK_SERVICE_NAME: name.to_s
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  class Stack
3
- VERSION = '0.0.83'
3
+ VERSION = '0.0.84'
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.83
4
+ version: 0.0.84
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artyom B