dry-stack 0.0.83 → 0.0.85
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dry-stack/stack.rb +7 -1
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8f1e3847018ae24bd44d57813f7fb37afaa95e1a2697426eea8a40593dc07bd
|
4
|
+
data.tar.gz: 5c64bd98e446a32f0edc36e98b5ef48e8812dc29183786e30f70263865dee2c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06bf607c465894d9b640b04c9209cca967a7430958281ff45d61501f67705c715cd5afa6cf7d93532619b7f27947d1eb8b33e3ff217364e74bb888fad087460d
|
7
|
+
data.tar.gz: bf1de07565b2adf380ae0189ea6f257c052793372c542070425bf779e087e8dd6f9183082852e84d6b59fe2c67d40313a65cc351cc855671a5ce744b1bf6cdf7
|
data/lib/dry-stack/stack.rb
CHANGED
@@ -47,6 +47,7 @@ module Dry
|
|
47
47
|
class ServiceFunction
|
48
48
|
def initialize(service, &); @service = service; instance_exec(&) end
|
49
49
|
def env(variables)= @service[:environment].merge! variables
|
50
|
+
def dns(dns)= ((@service[:dns] ||= []) << dns).flatten!
|
50
51
|
def volume(opts)= ((@service[:volumes] ||= []) << opts).flatten!
|
51
52
|
def image(name)= @service[:image] = name
|
52
53
|
def ports(ports)= ((@service[:ports] ||= []) << ports).flatten!
|
@@ -58,6 +59,7 @@ module Dry
|
|
58
59
|
def user(user) = @service[:user] = user # "${UID}:${GID}", "www-data:www-data"
|
59
60
|
def network(names) = (@service[:networks] ||= []) << names
|
60
61
|
def basic_auth(user_and_password) = @service[:basic_auth] = user_and_password
|
62
|
+
def ingress(ing) = ((@service[:ingress] ||=[]) << ing).flatten!
|
61
63
|
end
|
62
64
|
|
63
65
|
class SwarmFunction
|
@@ -144,7 +146,9 @@ module Dry
|
|
144
146
|
end
|
145
147
|
|
146
148
|
compose[:services].each do |name, service|
|
147
|
-
|
149
|
+
|
150
|
+
ingress = [@ingress[name], service[:ingress] || [] ].flatten.compact
|
151
|
+
|
148
152
|
service[:deploy] ||= {}
|
149
153
|
service[:deploy][:labels] ||= []
|
150
154
|
service[:deploy][:labels] += @labels.map { "#{_1}=#{_2}" }
|
@@ -169,6 +173,7 @@ module Dry
|
|
169
173
|
ingress[0][:port] ||= service[:ports]&.first
|
170
174
|
|
171
175
|
ingress.each_with_index do |ing, index|
|
176
|
+
|
172
177
|
if service[:basic_auth]
|
173
178
|
ba_user, ba_password, salt = service[:basic_auth].split ':'
|
174
179
|
hashed_password = apr1_crypt ba_password, (salt || rand(36**8).to_s(36))
|
@@ -210,6 +215,7 @@ module Dry
|
|
210
215
|
end
|
211
216
|
end
|
212
217
|
service.delete :basic_auth
|
218
|
+
service.delete :ingress
|
213
219
|
|
214
220
|
service[:environment] = @environment[name].merge(service[:environment]) if @environment[name]
|
215
221
|
service[:environment].merge! STACK_NAME: @name.to_s, STACK_SERVICE_NAME: name.to_s
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-stack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.85
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artyom B
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|