orchparty 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/orchparty/transformations/variable.rb +24 -13
- data/lib/orchparty/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5188728e716189c344e9a6d288670cc23be351f
|
4
|
+
data.tar.gz: 8f4f7ef1c744668761b7870c219b84c02f6752dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1318dcccb4853a0b4e100ff5b6d55aa7977d4225c9d739148dd3e75a9fda962d451406b8ad9ce112f87062c2a173536cac7e64976ac1d684a5c2f79fdf13c255
|
7
|
+
data.tar.gz: 7d8457abe046d21f86392d7ecd37a62ffd4bc7ee3a8f9df291e5293cce4abd5a430169727297aa7b0159781584d2014be3450bafcb4d1200fbd8188142c47d38
|
@@ -9,24 +9,31 @@ module Orchparty
|
|
9
9
|
def transform(ast)
|
10
10
|
ast.applications.each do |_, application|
|
11
11
|
application.services = application.services.each do |_, service|
|
12
|
-
service
|
12
|
+
resolve(application, service, service)
|
13
|
+
end
|
14
|
+
application.volumes = application.volumes.each do |_, volume|
|
15
|
+
resolve(application, volume, nil) if volume
|
16
|
+
end
|
17
|
+
end
|
18
|
+
ast
|
19
|
+
end
|
20
|
+
|
21
|
+
def resolve(application, subject, service)
|
22
|
+
subject.deep_transform_values! do |v|
|
23
|
+
if v.respond_to?(:call)
|
24
|
+
eval_value(build_context(application: application, service: service), v)
|
25
|
+
elsif v.is_a? Array
|
26
|
+
v.map do |v|
|
13
27
|
if v.respond_to?(:call)
|
14
28
|
eval_value(build_context(application: application, service: service), v)
|
15
|
-
elsif v.is_a? Array
|
16
|
-
v.map do |v|
|
17
|
-
if v.respond_to?(:call)
|
18
|
-
eval_value(build_context(application: application, service: service), v)
|
19
|
-
else
|
20
|
-
v
|
21
|
-
end
|
22
|
-
end
|
23
29
|
else
|
24
30
|
v
|
25
31
|
end
|
26
32
|
end
|
33
|
+
else
|
34
|
+
v
|
27
35
|
end
|
28
36
|
end
|
29
|
-
ast
|
30
37
|
end
|
31
38
|
|
32
39
|
def eval_value(context, value)
|
@@ -34,9 +41,13 @@ module Orchparty
|
|
34
41
|
end
|
35
42
|
|
36
43
|
def build_context(application:, service:)
|
37
|
-
application._variables
|
38
|
-
variables = application.
|
39
|
-
|
44
|
+
variables = application._variables || {}
|
45
|
+
variables = variables.merge({application: application.merge(application._variables)})
|
46
|
+
if service
|
47
|
+
variables = variables.merge(service._variables)
|
48
|
+
variables = variables.merge({service: service.merge(service._variables)})
|
49
|
+
end
|
50
|
+
context = Context.new(variables)
|
40
51
|
context._force_variable_definition = @force_variable_definition
|
41
52
|
context
|
42
53
|
end
|
data/lib/orchparty/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orchparty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jannis Huebl
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|