kameleon-builder 2.7.6 → 2.7.7
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/.bumpversion.cfg +1 -1
- data/CHANGES +7 -0
- data/lib/kameleon/engine.rb +2 -4
- data/lib/kameleon/recipe.rb +16 -8
- data/tests/issue76/fail.yaml +2 -2
- data/tests/issue76/ok.yaml +1 -1
- data/tests/issue76/steps/testbootstrap.yaml +1 -1
- data/tests/recipes/steps/bootstrap/BSD/bootstrap.yaml +3 -0
- data/tests/recipes/test_recipe.yaml +10 -6
- data/tests/recipes/test_recipe_child.yaml +2 -2
- data/tests/test2/test2.yaml +1 -1
- data/tests/test2/test_data.yaml +1 -1
- data/version.txt +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5e34e2008d8d28527303ac5b78527a80fc06f96
|
4
|
+
data.tar.gz: 9bc6f0b52f88122fc4d4bd499ab7648c48dac83a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 259a308508cee87db0640de5ccb7379c74e8b89ddd4ac17ae36aa77902554f89f842dc93b0a945ae9d92462811b1bb106dd7b403ba7f7a8e5c21d61b94303242
|
7
|
+
data.tar.gz: 390e8b95e415327dcfeaa00cf1b2759e8c0858d6974ffb7cff8023e04eb03777aa9c74e01d88cbb79f23ac6bf06769b09f2a59f7317b97030a5ec9043d721297
|
data/.bumpversion.cfg
CHANGED
data/CHANGES
CHANGED
data/lib/kameleon/engine.rb
CHANGED
@@ -35,11 +35,11 @@ module Kameleon
|
|
35
35
|
|
36
36
|
if @options[:enable_cache] || @options[:from_cache] then
|
37
37
|
if @recipe.global["in_context"]["proxy_cache"].nil? then
|
38
|
-
raise BuildError, "Missing
|
38
|
+
raise BuildError, "Missing variable for in context 'proxy_cache' when using the option --cache"
|
39
39
|
end
|
40
40
|
|
41
41
|
if @recipe.global["out_context"]["proxy_cache"].nil? then
|
42
|
-
raise BuildError, "Missing
|
42
|
+
raise BuildError, "Missing variable for out context 'proxy_cache' when using the option --cache"
|
43
43
|
end
|
44
44
|
@cache = Kameleon::Persistent_cache.instance
|
45
45
|
|
@@ -90,8 +90,6 @@ module Kameleon
|
|
90
90
|
def build_contexts
|
91
91
|
lazyload = @options.fetch(:lazyload, true)
|
92
92
|
fail_silently = @options.fetch(:fail_silently, false)
|
93
|
-
proxy_cache_out = @recipe.global["out_context"]["proxy_cache"]
|
94
|
-
proxy_cache_in = @recipe.global["in_context"]["proxy_cache"]
|
95
93
|
|
96
94
|
Kameleon.ui.debug("Building local context [local]")
|
97
95
|
@local_context = Context.new("local", "bash", "bash", @cwd, "", @cwd,
|
data/lib/kameleon/recipe.rb
CHANGED
@@ -32,6 +32,10 @@ module Kameleon
|
|
32
32
|
"export" => Section.new("export"),
|
33
33
|
}
|
34
34
|
@cli_global = Kameleon.env.global.clone
|
35
|
+
@cli_global.each do |k,v|
|
36
|
+
Kameleon.ui.warn("CLI Global variable override: #{k} => #{v}")
|
37
|
+
end
|
38
|
+
|
35
39
|
@global = {
|
36
40
|
"kameleon_recipe_name" => @name,
|
37
41
|
"kameleon_recipe_dir" => File.dirname(@path),
|
@@ -114,34 +118,38 @@ module Kameleon
|
|
114
118
|
@global[context_name].merge!(yaml_recipe["global"][context_name])
|
115
119
|
yaml_recipe["global"][context_name] = @global[context_name]
|
116
120
|
unless yaml_recipe["global"][context_name].keys.include? "interactive_cmd"
|
117
|
-
yaml_recipe["global"][context_name]["interactive_cmd"] = yaml_recipe["global"][context_name]['cmd']
|
121
|
+
yaml_recipe["global"][context_name]["interactive_cmd"] = yaml_recipe["global"][context_name]['cmd']
|
118
122
|
end
|
119
123
|
end
|
120
124
|
# Load Global variables
|
121
125
|
@global.merge!(yaml_recipe.fetch("global", {}))
|
122
126
|
# merge cli variable with recursive variable overload
|
123
127
|
@global = Utils.overload_merge(@global, @cli_global)
|
128
|
+
|
124
129
|
# Resolve dynamically-defined variables !!
|
125
130
|
resolved_global = Utils.resolve_vars(@global.to_yaml, @path, @global, self, kwargs)
|
126
131
|
resolved_global = @global.merge YAML.load(resolved_global)
|
132
|
+
Kameleon.ui.debug("Resolved_global: #{resolved_global}")
|
127
133
|
# Loads aliases
|
128
134
|
load_aliases(yaml_recipe)
|
129
135
|
# Load env files
|
130
136
|
load_env_files(yaml_recipe)
|
131
137
|
# Loads checkpoint configuration
|
132
138
|
load_checkpoint_config(yaml_recipe)
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
139
|
+
include_steps = resolved_global['include_steps']
|
140
|
+
include_steps ||= []
|
141
|
+
include_steps.push ''
|
142
|
+
include_steps.flatten!
|
143
|
+
include_steps.compact!
|
144
|
+
Kameleon.ui.debug("include steps: #{include_steps}")
|
138
145
|
@sections.values.each do |section|
|
139
146
|
dir_to_search = @steps_dirs.map do |steps_dir|
|
140
|
-
|
147
|
+
include_steps.map do |path|
|
141
148
|
[File.join(steps_dir, section.name, path),
|
142
149
|
File.join(steps_dir, path)]
|
143
150
|
end
|
144
151
|
end.flatten.select { |x| File.exists? x }
|
152
|
+
Kameleon.ui.debug("Directory to search for steps: #{dir_to_search}")
|
145
153
|
|
146
154
|
if yaml_recipe.key? section.name
|
147
155
|
yaml_section = yaml_recipe.fetch(section.name)
|
@@ -311,7 +319,7 @@ module Kameleon
|
|
311
319
|
end
|
312
320
|
end
|
313
321
|
rel_dir_search = dir_search.map do |steps_dir|
|
314
|
-
|
322
|
+
Pathname.new(steps_dir).relative_path_from(Pathname(Dir.pwd)).to_s
|
315
323
|
end.flatten
|
316
324
|
fail RecipeError, "File '#{global_file}' not found here #{rel_dir_search}"
|
317
325
|
end
|
data/tests/issue76/fail.yaml
CHANGED
data/tests/issue76/ok.yaml
CHANGED
@@ -12,12 +12,16 @@ aliases: defaults.yaml
|
|
12
12
|
checkpoint: test.yaml
|
13
13
|
#== Global variables use by Kameleon engine and the steps
|
14
14
|
global:
|
15
|
+
|
16
|
+
include_steps:
|
17
|
+
- $${distrib}
|
18
|
+
|
15
19
|
## User varibales : used by the recipe
|
16
20
|
user_name: kameleon_user
|
17
|
-
user_password: $$user_name
|
21
|
+
user_password: $${user_name}
|
18
22
|
|
19
23
|
# test overload
|
20
|
-
toto: $$toto tata
|
24
|
+
toto: $${toto} tata
|
21
25
|
|
22
26
|
# Distribution
|
23
27
|
distrib: linux
|
@@ -25,7 +29,7 @@ global:
|
|
25
29
|
## System variables. Required by kameleon engine
|
26
30
|
# Include specific steps
|
27
31
|
include_steps:
|
28
|
-
- $$distrib
|
32
|
+
- $${distrib}
|
29
33
|
|
30
34
|
bootstrap_packages: >
|
31
35
|
less vim python
|
@@ -42,7 +46,7 @@ global:
|
|
42
46
|
bootstrap:
|
43
47
|
- enable_something
|
44
48
|
- bootstrap:
|
45
|
-
- include_pkg: $$bootstrap_packages
|
49
|
+
- include_pkg: $${bootstrap_packages}
|
46
50
|
|
47
51
|
setup:
|
48
52
|
- software_install
|
@@ -53,10 +57,10 @@ setup:
|
|
53
57
|
echo titi
|
54
58
|
- do_something_else:
|
55
59
|
- exec_local: |
|
56
|
-
echo $$toto $$user_name
|
60
|
+
echo $${toto} $${user_name}
|
57
61
|
- test_data:
|
58
62
|
- exec_local: cat $${kameleon_data_dir}/mydata.txt
|
59
|
-
- exec_local: cat $$kameleon_data_dir/mydata.txt
|
63
|
+
- exec_local: cat $${kameleon_data_dir}/mydata.txt
|
60
64
|
- local_variables
|
61
65
|
|
62
66
|
- test_uuid_step:
|
data/tests/test2/test2.yaml
CHANGED
data/tests/test2/test_data.yaml
CHANGED
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.7.
|
1
|
+
2.7.7
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kameleon-builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salem Harrache
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2016-
|
15
|
+
date: 2016-09-01 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: childprocess
|
@@ -183,6 +183,7 @@ files:
|
|
183
183
|
- tests/issue76/ok.yaml
|
184
184
|
- tests/issue76/steps/testbootstrap.yaml
|
185
185
|
- tests/recipes/steps/aliases/defaults.yaml
|
186
|
+
- tests/recipes/steps/bootstrap/BSD/bootstrap.yaml
|
186
187
|
- tests/recipes/steps/bootstrap/linux/bootstrap.yaml
|
187
188
|
- tests/recipes/steps/checkpoints/test.yaml
|
188
189
|
- tests/recipes/steps/enable_something.yaml
|
@@ -234,6 +235,7 @@ test_files:
|
|
234
235
|
- tests/issue76/ok.yaml
|
235
236
|
- tests/issue76/steps/testbootstrap.yaml
|
236
237
|
- tests/recipes/steps/aliases/defaults.yaml
|
238
|
+
- tests/recipes/steps/bootstrap/BSD/bootstrap.yaml
|
237
239
|
- tests/recipes/steps/bootstrap/linux/bootstrap.yaml
|
238
240
|
- tests/recipes/steps/checkpoints/test.yaml
|
239
241
|
- tests/recipes/steps/enable_something.yaml
|