kameleon-builder 2.10.6 → 2.10.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.bumpversion.cfg +1 -1
- data/CHANGES +15 -0
- data/lib/kameleon/cli.rb +2 -2
- data/lib/kameleon/context.rb +1 -0
- data/lib/kameleon/repository.rb +1 -1
- data/lib/kameleon/shell.rb +1 -1
- data/lib/kameleon/utils.rb +24 -14
- data/lib/kameleon/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: 553ea238eb5037446a3a2fd352806d8f32bc19d728288b60b515d00c606c8862
|
4
|
+
data.tar.gz: 8ec292f91ce56340f1492f1c8f9533b4615fb108029d4985eb515d5c08a97a14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b57c04cd35dbeb46a61dbb9b1a433b141f7952e8db071795505c061781ccbf63df33f4d3540f9c3c9d530ba7c4e3fa9d25f3397ea81e3abd17b85bbf7a75e35
|
7
|
+
data.tar.gz: 69179ec31b646c1b98c42817a880aa2423a316ada9338383f7fb88f7d4f9f0aefd40808803df4e5dd129d50a2f85218544c57223126f79121f6af2427a821691
|
data/.bumpversion.cfg
CHANGED
data/CHANGES
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
Kameleon CHANGELOG
|
2
2
|
==================
|
3
3
|
|
4
|
+
Version 2.10.8
|
5
|
+
--------------
|
6
|
+
|
7
|
+
Released on October 21st 2022
|
8
|
+
|
9
|
+
- Fix a fatal error with the pipe command: make sure the destination context is started.
|
10
|
+
- Avoid git warning when running kameleon repo update: use git pull --ff-only
|
11
|
+
|
12
|
+
Version 2.10.7
|
13
|
+
--------------
|
14
|
+
|
15
|
+
Released on December 02nd 2021
|
16
|
+
|
17
|
+
- Add support for the .filter file to filter recipes/template lists
|
18
|
+
|
4
19
|
Version 2.10.6
|
5
20
|
--------------
|
6
21
|
|
data/lib/kameleon/cli.rb
CHANGED
@@ -60,7 +60,7 @@ module Kameleon
|
|
60
60
|
method_option :progress, :type => :boolean, :default => true,
|
61
61
|
:desc => "Show progress bar while resolving templates",
|
62
62
|
:aliases => "-p"
|
63
|
-
method_option :filter, :type => :string, :default =>
|
63
|
+
method_option :filter, :type => :string, :default => nil,
|
64
64
|
:desc => "Filter templates with the given regexp",
|
65
65
|
:aliases => "-f"
|
66
66
|
def list
|
@@ -175,7 +175,7 @@ module Kameleon
|
|
175
175
|
method_option :progress, :type => :boolean, :default => false,
|
176
176
|
:desc => "Show progress bar while resolving recipes",
|
177
177
|
:aliases => "-p"
|
178
|
-
method_option :filter, :type => :string, :default =>
|
178
|
+
method_option :filter, :type => :string, :default => nil,
|
179
179
|
:desc => "Filter recipes with the given regexp",
|
180
180
|
:aliases => "-f"
|
181
181
|
def list
|
data/lib/kameleon/context.rb
CHANGED
@@ -106,6 +106,7 @@ module Kameleon
|
|
106
106
|
|
107
107
|
Kameleon.ui.verbose("Forwarding #{tmp.path} to STDIN of #{other_ctx.name}_ctx")
|
108
108
|
dest_pipe_path = "${KAMELEON_WORKDIR}/pipe-#{ Kameleon::Utils.generate_slug(other_cmd)[0..20] }"
|
109
|
+
other_ctx.load_shell
|
109
110
|
other_ctx.send_file(tmp.path, dest_pipe_path)
|
110
111
|
other_cmd_with_pipe = "cat #{dest_pipe_path} | #{other_cmd} && rm #{dest_pipe_path}"
|
111
112
|
other_ctx.execute(other_cmd_with_pipe, kwargs)
|
data/lib/kameleon/repository.rb
CHANGED
@@ -30,7 +30,7 @@ module Kameleon
|
|
30
30
|
git_repo = File.join(Kameleon.env.repositories_path, name)
|
31
31
|
raise RepositoryError, "Repository not found '#{name}'" if not File.directory?(git_repo)
|
32
32
|
cmd = ["git", "--git-dir", File.join(git_repo, ".git"), "--work-tree",
|
33
|
-
git_repo, "pull", "--
|
33
|
+
git_repo, "pull", "--ff-only"]
|
34
34
|
process = ChildProcess.build(*cmd)
|
35
35
|
process.io.inherit!
|
36
36
|
process.start
|
data/lib/kameleon/shell.rb
CHANGED
data/lib/kameleon/utils.rb
CHANGED
@@ -125,11 +125,11 @@ module Kameleon
|
|
125
125
|
end
|
126
126
|
end
|
127
127
|
|
128
|
-
def self.list_recipes(recipes_path, filter
|
128
|
+
def self.list_recipes(recipes_path, filter, do_progressbar = false, is_repository = false, kwargs = {})
|
129
129
|
Kameleon.env.root_dir = recipes_path
|
130
130
|
catch_exception = kwargs.fetch(:catch_exception, true)
|
131
131
|
recipes_hash = []
|
132
|
-
recipes_files = get_recipes(recipes_path
|
132
|
+
recipes_files = get_recipes(recipes_path, filter)
|
133
133
|
if recipes_files.empty?
|
134
134
|
Kameleon.ui.shell.say " <None>", :cyan
|
135
135
|
return
|
@@ -162,7 +162,7 @@ module Kameleon
|
|
162
162
|
desc_width = (80 - name_width - 3) if desc_width < 0
|
163
163
|
end
|
164
164
|
repo_str_old = nil
|
165
|
-
recipes_hash.
|
165
|
+
recipes_hash.each do |r|
|
166
166
|
if is_repository
|
167
167
|
repo_str,recipe_dir_str,recipe_str = r["name"].match(%r{^([^/]+/)(.+/)?([^/]+)$}).to_a[1..3].map{|m| m.to_s}
|
168
168
|
else
|
@@ -184,18 +184,28 @@ module Kameleon
|
|
184
184
|
end
|
185
185
|
end
|
186
186
|
|
187
|
-
def self.get_recipes(path)
|
188
|
-
path
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
187
|
+
def self.get_recipes(path, filter = nil, base = nil)
|
188
|
+
base = path if base.nil?
|
189
|
+
if filter.nil?
|
190
|
+
begin
|
191
|
+
filter = File.read(File.join(path, "/.filter")).chomp
|
192
|
+
Kameleon.ui.verbose("Found filter #{filter} in #{path}")
|
193
|
+
base = path
|
194
|
+
rescue
|
195
|
+
end
|
196
|
+
end
|
197
|
+
recipes = path.children.select{|child| child.file? and child.extname == ".yaml"}.map do |child|
|
198
|
+
recipe = child.to_s.gsub(base.to_s + '/', '').chomp('.yaml')
|
199
|
+
if filter.nil? or Regexp.new(filter).match(recipe)
|
200
|
+
child
|
201
|
+
else
|
202
|
+
Kameleon.ui.verbose("Filters out #{recipe}, does not match #{filter}")
|
203
|
+
nil
|
197
204
|
end
|
198
|
-
end.select { |x| x }.flatten(1)
|
205
|
+
end.select { |x| x }.flatten(1).sort{|a,b| a.to_s <=> b.to_s}
|
206
|
+
recipes + path.children.select{|child| child.directory? and child.basename.to_s != "steps" and child.basename.to_s != ".steps"}.sort{|a,b| a.to_s <=> b.to_s}.map do |child|
|
207
|
+
get_recipes(child, filter, base)
|
208
|
+
end.flatten(1)
|
199
209
|
end
|
200
210
|
|
201
211
|
def self.which(cmd)
|
data/lib/kameleon/version.rb
CHANGED
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.10.
|
4
|
+
version: 2.10.8
|
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:
|
15
|
+
date: 2022-10-21 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: childprocess
|