dry-stack 0.1.6 → 0.1.8
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 +28 -0
- 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: 2013846706c90a279211a43e86dd57cca783a058ef62f557b61b0860486d0da6
|
4
|
+
data.tar.gz: bdb26f28293c601e5ea3be9190ab0b3834ff1c2800cf2b2033c3fc7b7d9c5f97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c7dd8efd6e55b5cebe69bc8fef7f1eed626441874b0e8e601e814f590c9507eeee7ccaa6337760f3ab51d318d002104f44fc43aded90cf4b8f182129b4795d0
|
7
|
+
data.tar.gz: 04fd919fc49b22dca5c014b123ffcab12734c74db06daf4d796cfee7e249e5080039b9e7ce985984deca640685233002ae88886157fad798469b0c15759f237e
|
data/lib/dry-stack/stack.rb
CHANGED
@@ -262,6 +262,23 @@ module Dry
|
|
262
262
|
end
|
263
263
|
end
|
264
264
|
|
265
|
+
service[:networks]&.map! do |network|
|
266
|
+
if network.is_a?(Hash)
|
267
|
+
if network.key?(:name)
|
268
|
+
n_name = network[:name].gsub('-','_').to_sym
|
269
|
+
if n_name != :default
|
270
|
+
(compose[:networks][n_name] ||= {}).merge! network
|
271
|
+
end
|
272
|
+
n_name
|
273
|
+
else
|
274
|
+
$stderr.puts ':name must be specified in network declaration'
|
275
|
+
raise 'invalid network declaration'
|
276
|
+
end
|
277
|
+
else
|
278
|
+
network
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
265
282
|
service[:configs]&.each_with_index do |config, index|
|
266
283
|
config[:source] = "#{service_name}-config-#{index}" if config[:source].to_s.empty?
|
267
284
|
compose[:configs][config[:source].to_sym] ||= {}
|
@@ -315,6 +332,17 @@ module Dry
|
|
315
332
|
(@after_blocks ||=[]) << block
|
316
333
|
end
|
317
334
|
|
335
|
+
# TODO: latter
|
336
|
+
# def ServicesEach(names, &)
|
337
|
+
# def ServicesEach(names, opts, &)
|
338
|
+
def ServicesEach(&)
|
339
|
+
After do
|
340
|
+
@services.values.each do |svc|
|
341
|
+
ServiceFunction.new(svc,&) if block_given?
|
342
|
+
end
|
343
|
+
end
|
344
|
+
end
|
345
|
+
|
318
346
|
def PublishPorts(ports)
|
319
347
|
@publish_ports.merge! ports.to_h { |k, v| [k,[v].flatten] }
|
320
348
|
end
|
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.1.
|
4
|
+
version: 0.1.8
|
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-07-
|
11
|
+
date: 2024-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|