dry-stack 0.1.4 → 0.1.6
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/command_line.rb +7 -1
- data/lib/dry-stack/stack.rb +12 -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: 8b7592331dd36eea2532e592b77b79cbfd7e63c3f629d585711c94b028269fe2
|
4
|
+
data.tar.gz: 2b7728492289f69ec986471cdc5782930c1f060d408dc449b2c4bf6b7017f970
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c13514eb9ca9b88f12b244cd501e207cc6a641e9a6e5dd12d12268c4685c4adc9b8eed2219d3488d45d0cfed8704b817c62ab969bdbf8861c5f382f359ba10c
|
7
|
+
data.tar.gz: e3100351c69491951e4ddd949f9b21d3bdf817fc3ebc5b7248e95064db9b97ed113ae4ca9c19509e084d97e247f434dd7685b56f031131373acd700d09948353
|
@@ -38,7 +38,10 @@ module Dry
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def safe_eval(drs, params)
|
41
|
-
Dry::Stack(params[:name], params[:configuration])
|
41
|
+
Dry::Stack(params[:name], params[:configuration]) do
|
42
|
+
eval drs, self.binding
|
43
|
+
@after_blocks&.each { instance_exec &_1 }
|
44
|
+
end
|
42
45
|
end
|
43
46
|
|
44
47
|
def run(args)
|
@@ -82,6 +85,9 @@ module Dry
|
|
82
85
|
|
83
86
|
params.transform_keys!{_1.to_s.gsub('-','_').to_sym}
|
84
87
|
params[:traefik_tls] = true if params[:tls_domain]
|
88
|
+
params[:traefik] = true unless params.key? :traefik
|
89
|
+
|
90
|
+
Dry.cmd_params = params
|
85
91
|
|
86
92
|
raise 'Stack file not defined' if $stdin.tty? && !params[:stack]
|
87
93
|
|
data/lib/dry-stack/stack.rb
CHANGED
@@ -39,6 +39,9 @@ module Dry
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
+
attr_accessor :cmd_params
|
43
|
+
@cmd_params = {}
|
44
|
+
|
42
45
|
def Stack(name = nil, configuration = nil, &)
|
43
46
|
Stack.last_stack = Stack.new name
|
44
47
|
Stack.last_stack.instance_exec(&) if block_given?
|
@@ -303,6 +306,15 @@ module Dry
|
|
303
306
|
JSON.parse(compose.to_json).to_yaml
|
304
307
|
end
|
305
308
|
|
309
|
+
def Include(file_name)
|
310
|
+
dir = Dry.cmd_params[:stack] ? File.dirname(Dry.cmd_params[:stack]) : '.'
|
311
|
+
eval IO.read( File.join dir, file_name )
|
312
|
+
end
|
313
|
+
|
314
|
+
def After(&block)
|
315
|
+
(@after_blocks ||=[]) << block
|
316
|
+
end
|
317
|
+
|
306
318
|
def PublishPorts(ports)
|
307
319
|
@publish_ports.merge! ports.to_h { |k, v| [k,[v].flatten] }
|
308
320
|
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.6
|
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-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|