kameleon-builder 2.3.2 → 2.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rst +8 -0
- data/lib/kameleon/environment.rb +1 -0
- data/lib/kameleon/recipe.rb +33 -7
- data/lib/kameleon/utils.rb +1 -0
- data/version.txt +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: 1f207b02d46c496660b255e40159798760304278
|
4
|
+
data.tar.gz: 7f7833890e5fe3a60bf922b99a5e84603cf34ac9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad4db58b04ddcd23868e650712603be2345237278b75698062de0c146c3cf54800bb92d97f40b5f71329adba9ad8bc00c26c3fa10ad53df372ab17d42f8df752
|
7
|
+
data.tar.gz: 46e1f4e26176f3658840a46969b78de8ff2646ce595cf937f90296b939d61f4c6ee908edeb9d8531da5f3439ac3efb6514b4eb10d953a11c292676f0bc7d7a7f
|
data/CHANGELOG.rst
CHANGED
data/lib/kameleon/environment.rb
CHANGED
@@ -22,6 +22,7 @@ module Kameleon
|
|
22
22
|
:build_path => Pathname.new(build_path),
|
23
23
|
:cache_path => Pathname.new(cache_path),
|
24
24
|
:repositories_path => Pathname.new(repositories_path),
|
25
|
+
:root_dir => Pathname.new(workspace),
|
25
26
|
}
|
26
27
|
options = Kameleon.default_values.merge(options).merge(env_options)
|
27
28
|
Kameleon.ui.debug("Environment initialized (#{self})")
|
data/lib/kameleon/recipe.rb
CHANGED
@@ -38,13 +38,31 @@ module Kameleon
|
|
38
38
|
@files = []
|
39
39
|
Kameleon.ui.debug("Initialize new recipe (#{path})")
|
40
40
|
@base_recipes_files = [@path]
|
41
|
-
@steps_dirs = [
|
42
|
-
|
43
|
-
|
44
|
-
]
|
41
|
+
@steps_dirs = []
|
42
|
+
steps_dir = get_default_steps_dir
|
43
|
+
@steps_dirs.push(steps_dir) unless steps_dir.nil?
|
45
44
|
load! :strict => false
|
46
45
|
end
|
47
46
|
|
47
|
+
def get_default_steps_dir
|
48
|
+
relative_path = @path.to_path.gsub(Kameleon.env.root_dir.to_path + '/', '')
|
49
|
+
last_dir = Kameleon.env.root_dir
|
50
|
+
subdirs = [last_dir]
|
51
|
+
relative_path.split("/")[0...-1].each do |p|
|
52
|
+
subdir = last_dir.join(p)
|
53
|
+
subdirs.push(subdir)
|
54
|
+
last_dir = subdir
|
55
|
+
end
|
56
|
+
steps_dirs = []
|
57
|
+
subdirs.reverse_each do |p|
|
58
|
+
steps_dirs.push(File.expand_path(File.join(p.to_path, 'steps')))
|
59
|
+
steps_dirs.push(File.expand_path(File.join(p.to_path, '.steps')))
|
60
|
+
end
|
61
|
+
steps_dirs.each do |p|
|
62
|
+
return p if File.exist? p
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
48
66
|
def load!(kwargs = {})
|
49
67
|
# Find recipe path
|
50
68
|
Kameleon.ui.debug("Loading #{@path}")
|
@@ -61,8 +79,10 @@ module Kameleon
|
|
61
79
|
# Where we can find steps
|
62
80
|
@base_recipes_files.each do |recipe_path|
|
63
81
|
dirname = File.dirname(recipe_path)
|
64
|
-
|
65
|
-
|
82
|
+
['steps', '.steps'].each do |p|
|
83
|
+
dir = File.expand_path(File.join(dirname, p))
|
84
|
+
@steps_dirs.push(dir) if File.exists? dir
|
85
|
+
end
|
66
86
|
end
|
67
87
|
@steps_dirs.uniq!
|
68
88
|
|
@@ -86,7 +106,8 @@ module Kameleon
|
|
86
106
|
[File.join(steps_dir, section.name, path),
|
87
107
|
File.join(steps_dir, path)]
|
88
108
|
end
|
89
|
-
end.flatten
|
109
|
+
end.flatten.select { |x| File.exists? x }
|
110
|
+
|
90
111
|
if yaml_recipe.key? section.name
|
91
112
|
yaml_section = yaml_recipe.fetch(section.name)
|
92
113
|
next unless yaml_section.kind_of? Array
|
@@ -584,6 +605,11 @@ module Kameleon
|
|
584
605
|
end
|
585
606
|
|
586
607
|
class RecipeTemplate < Recipe
|
608
|
+
|
609
|
+
def initialize(path, kwargs = {})
|
610
|
+
super(path, kwargs)
|
611
|
+
end
|
612
|
+
|
587
613
|
def relative_path_from_recipe(recipe_path)
|
588
614
|
recipe_path = Pathname.new(recipe_path)
|
589
615
|
relative_path_tpl_repo = @path.relative_path_from(Kameleon.env.repositories_path)
|
data/lib/kameleon/utils.rb
CHANGED
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.3
|
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.3.
|
4
|
+
version: 2.3.3
|
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: 2014-11-
|
15
|
+
date: 2014-11-26 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: childprocess
|