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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6756bd8febc8f8df6fd15c685eb8c4b20662b38f
4
- data.tar.gz: 7333259e498919e6a1ca2da029bd5930c426e298
3
+ metadata.gz: c5e34e2008d8d28527303ac5b78527a80fc06f96
4
+ data.tar.gz: 9bc6f0b52f88122fc4d4bd499ab7648c48dac83a
5
5
  SHA512:
6
- metadata.gz: 99fecf54c7f95c67303cf532b75364b0484df0f88246917918be084296174b0ca839ad5bcc840a30c88d13be1ad185c26b658db8de92178058fa5fe0089f7275
7
- data.tar.gz: d0a2fef734d9cfed18e580b6c2fcdf44d7579c1ed6a9365f25aaba80828db8f7d94dda858b550b8861d71465e568d5e084a7c670236785bee5fe04bd3d8faa5f
6
+ metadata.gz: 259a308508cee87db0640de5ccb7379c74e8b89ddd4ac17ae36aa77902554f89f842dc93b0a945ae9d92462811b1bb106dd7b403ba7f7a8e5c21d61b94303242
7
+ data.tar.gz: 390e8b95e415327dcfeaa00cf1b2759e8c0858d6974ffb7cff8023e04eb03777aa9c74e01d88cbb79f23ac6bf06769b09f2a59f7317b97030a5ec9043d721297
@@ -1,7 +1,7 @@
1
1
  [bumpversion]
2
2
  commit = True
3
3
  tag = True
4
- current_version = 2.7.6
4
+ current_version = 2.7.7
5
5
  parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+))?
6
6
  serialize =
7
7
  {major}.{minor}.{patch}.{release}
data/CHANGES CHANGED
@@ -1,6 +1,13 @@
1
1
  Kameleon CHANGELOG
2
2
  ==================
3
3
 
4
+ Version 2.7.7
5
+ -------------
6
+
7
+ Released on September 01st 2016
8
+
9
+ - Add some warning to avoid global CLI option misuse
10
+
4
11
  Version 2.7.6
5
12
  -------------
6
13
 
@@ -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 varible for in context 'proxy_cache' when using the option --cache"
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 varible for out context 'proxy_cache' when using the option --cache"
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,
@@ -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
- resolved_global['include_steps'] ||= []
135
- resolved_global['include_steps'].push ''
136
- resolved_global['include_steps'].flatten!
137
- resolved_global['include_steps'].compact!
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
- resolved_global['include_steps'].map do |path|
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
- relative_path = Pathname.new(steps_dir).relative_path_from(Pathname(Dir.pwd)).to_s
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
@@ -1,10 +1,10 @@
1
1
  global:
2
2
  arch: x86_64
3
- iso_arch: $$arch
3
+ iso_arch: $${arch}
4
4
  iso_filename: debian-jessie-$${iso_arch}-live.iso
5
5
 
6
6
  bootstrap:
7
7
  - testbootstrap:
8
- - toto: $$arch
8
+ - toto: $${arch}
9
9
  - step:
10
10
  - exec_local: echo $iso_filename
@@ -8,4 +8,4 @@ bootstrap:
8
8
  - testbootstrapinline:
9
9
  - titi: $arch
10
10
  - step:
11
- - exec_local: echo $$iso_filename $$titi
11
+ - exec_local: echo $${iso_filename} $${titi}
@@ -1,3 +1,3 @@
1
1
  - toto: $${arch}-toto
2
2
  - step:
3
- - exec_local: echo $$iso_filename $$toto
3
+ - exec_local: echo $${iso_filename} $${toto}
@@ -0,0 +1,3 @@
1
+ - bootstrap:
2
+ - exec_local: echo BSD
3
+ - exec_out: echo $include_pkg
@@ -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:
@@ -8,6 +8,6 @@ setup:
8
8
  - inline_step:
9
9
  - do_something_else:
10
10
  - exec_local: |
11
- echo $$toto $$user_name
12
- echo $$test_override
11
+ echo $${toto} $${user_name}
12
+ echo $${test_override}
13
13
 
@@ -1,3 +1,3 @@
1
1
  extend: ./test3.yaml
2
2
  global:
3
- toto: $$toto test $$user_name
3
+ toto: $${toto} test $${user_name}
@@ -4,4 +4,4 @@ setup:
4
4
  - "@base"
5
5
  - test_data:
6
6
  - do_test:
7
- - exec_local: cat $$kameleon_data_dir/mydata.txt
7
+ - exec_local: cat $${kameleon_data_dir}/mydata.txt
@@ -1 +1 @@
1
- 2.7.6
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.6
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-08-31 00:00:00.000000000 Z
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