kameleon-builder 2.10.5 → 2.10.6

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
  SHA256:
3
- metadata.gz: aeb30622025baa485ebc09845773b1e39db3b701494c01e6a3ac32b94d9f4faa
4
- data.tar.gz: ea307b68b21479e3f930ffdd53536d9616332037524efca18b25804cb02e616b
3
+ metadata.gz: e3fd959d36bbd756d9a632b39e1d9bdd1bcaa5a0c4fd8104187041473dbd4ae0
4
+ data.tar.gz: 3d36533205a0a55d3e2622ff1f713f4c2432f6cd48c34afc9bd35006855e9302
5
5
  SHA512:
6
- metadata.gz: 4cd740a9d6156e3e6c0ab480e103b8cf4b2d4cb67634c599c2a3fa4f99553d8b067bd00eee821b49a66cec4816450c59cf021298117f413f07b1796e2c0c682e
7
- data.tar.gz: ea1d8fa490900e1263c9603008df2b174422f6026ae5d8b31b21d71ad56daf4330bc18ade35a9488c12ab3665b468604d1b56baa944553fc95299596107f44a5
6
+ metadata.gz: 2915fa5554adacbbeda1d03655bf995ab8191e9396649adc2cd158a386926b00f991da040144bb35b5d15ca37e127222400749f3d82c6e00fe934cce4bf851f2
7
+ data.tar.gz: c0c5754fcffb10f0c1d80b5523accf99768facc1468190ffd3991842d05edeacdedfef9d0b5651dc844b90dddc8c535234de2214f1d47177c42fbeada596531c
data/.bumpversion.cfg CHANGED
@@ -1,7 +1,7 @@
1
1
  [bumpversion]
2
2
  commit = True
3
3
  tag = True
4
- current_version = 2.10.5
4
+ current_version = 2.10.6
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,14 @@
1
1
  Kameleon CHANGELOG
2
2
  ==================
3
3
 
4
+ Version 2.10.6
5
+ --------------
6
+
7
+ Released on November 24th 2021
8
+
9
+ - Add the option filter for the template and recipe listings
10
+ - Preserve permission of files when importing template
11
+
4
12
  Version 2.10.5
5
13
  --------------
6
14
 
data/RELEASING.md ADDED
@@ -0,0 +1,69 @@
1
+ About releases:
2
+ ===============
3
+ You can use the script ``./scripts/bumpversion.py`` which will handle
4
+ everything (incrementation, git tag creation, changelog update).
5
+ First you need to install bumpversion using pip::
6
+ ```
7
+ sudo pip install bumpversion
8
+ ```
9
+ Assuming work is done in the devel branch.
10
+
11
+ For stable releases:
12
+ --------------------
13
+
14
+ ## Merge devel into master:
15
+ ```
16
+ git checkout master
17
+ git merge devel
18
+ ```
19
+
20
+ ## Fix anything needed
21
+ Should be no conflict but...
22
+ Make sure changelog is up to date.
23
+
24
+ ## Bump version
25
+ ***Warning*** Make sure that there is no dirty file (not committed) before the following.
26
+ ```
27
+ ./scripts/bumpversion.py release # will do 2.7.0.dev -> 2.7.0 + git tag + changelog
28
+ git push
29
+ ```
30
+
31
+ ## Build gem
32
+ ```
33
+ gem build kameleon-builder.gemspec
34
+ ```
35
+
36
+ ## Push to Ruby gem repository
37
+ ```
38
+ gem push kameleon-builder-2.7.0.gem
39
+ ```
40
+
41
+ Note: You need a rubygem account and the owner has to give you permissions so that you can push.
42
+ To do so, create an account on https://rubygems.org/ and ask an owner to do
43
+ the following command::
44
+
45
+ ```
46
+ gem owner kameleon-builder -a your@email.com
47
+ ```
48
+
49
+ That's all :)
50
+
51
+ For devel releases:
52
+ -------------------
53
+
54
+ ## Move to the devel branch and rebase on master
55
+ ```
56
+ git checkout devel
57
+ git rebase master
58
+ ```
59
+
60
+ ## Prepare the new version
61
+ Create the new devel version (e.g. 2.7.0 dev)
62
+ ```
63
+ ./scripts/bumpversion.py newversion patch # 2.6.7 -> 2.7.0.dev
64
+ ```
65
+
66
+ At this point, do work, commit, and so on.
67
+ And same as above to build "devel" gem and use them locally, or push them if really wanted.
68
+
69
+ Up to the time to build a new stable version.
data/lib/kameleon/cli.rb CHANGED
@@ -60,10 +60,13 @@ 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 => '',
64
+ :desc => "Filter templates with the given regexp",
65
+ :aliases => "-f"
63
66
  def list
64
67
  Kameleon.ui.shell.say "Recipe templates available in: ", :red, false
65
68
  Kameleon.ui.shell.say Kameleon.env.repositories_path.to_s, :yellow
66
- Utils.list_recipes(Kameleon.env.repositories_path, options[:progress], true)
69
+ Utils.list_recipes(Kameleon.env.repositories_path, options[:filter], options[:progress], true)
67
70
  end
68
71
 
69
72
  desc "import <TEMPLATE_NAME>", "Imports the given template"
@@ -93,6 +96,7 @@ module Kameleon
93
96
  relative_path = path.relative_path_from(Kameleon.env.repositories_path)
94
97
  dst = File.join(Kameleon.env.workspace, relative_path)
95
98
  copy_file(path, dst)
99
+ chmod(dst, File.stat(path).mode, {:verbose=>false})
96
100
  end
97
101
  end
98
102
  end
@@ -169,11 +173,14 @@ module Kameleon
169
173
 
170
174
  desc "list", "Lists all defined recipes in the current directory"
171
175
  method_option :progress, :type => :boolean, :default => false,
172
- :desc => "Show progress bar while resolving templates",
176
+ :desc => "Show progress bar while resolving recipes",
173
177
  :aliases => "-p"
178
+ method_option :filter, :type => :string, :default => '',
179
+ :desc => "Filter recipes with the given regexp",
180
+ :aliases => "-f"
174
181
  def list
175
182
  Kameleon.ui.shell.say "Workspace recipes:", :red
176
- Utils.list_recipes(Kameleon.env.workspace, options[:progress])
183
+ Utils.list_recipes(Kameleon.env.workspace, options[:filter], options[:progress])
177
184
  end
178
185
 
179
186
  desc "new <RECIPE_PATH> <TEMPLATE_NAME>", "Creates a new recipe from template <TEMPLATE_NAME>"
@@ -212,6 +219,7 @@ module Kameleon
212
219
  relative_path = path.relative_path_from(Kameleon.env.repositories_path)
213
220
  dst = File.join(Kameleon.env.workspace, relative_path)
214
221
  copy_file(path, dst)
222
+ chmod(dst, File.stat(path).mode, {:verbose=>false})
215
223
  end
216
224
  Dir::mktmpdir do |tmp_dir|
217
225
  recipe_temp = File.join(tmp_dir, File.basename(recipe_path))
@@ -125,11 +125,11 @@ module Kameleon
125
125
  end
126
126
  end
127
127
 
128
- def self.list_recipes(recipes_path, do_progressbar = false, is_repository = false, kwargs = {})
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).select { |f| Regexp.new(filter).match(f.to_s.gsub(recipes_path.to_s + '/', '').chomp('.yaml')) }
133
133
  if recipes_files.empty?
134
134
  Kameleon.ui.shell.say " <None>", :cyan
135
135
  return
@@ -1,3 +1,3 @@
1
1
  module Kameleon
2
- VERSION = '2.10.5'
2
+ VERSION = '2.10.6'
3
3
  end
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.5
4
+ version: 2.10.6
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: 2021-07-29 00:00:00.000000000 Z
15
+ date: 2021-11-24 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: childprocess
@@ -131,7 +131,7 @@ files:
131
131
  - COPYING
132
132
  - Gemfile
133
133
  - README.rst
134
- - RELEASING.rst
134
+ - RELEASING.md
135
135
  - Vagrantfile
136
136
  - bin/kameleon
137
137
  - completion/_kameleon
data/RELEASING.rst DELETED
@@ -1,29 +0,0 @@
1
- You can use the script ``./scripts/bumpversion.py`` which will handle
2
- everything (incrementation, git tag creation, changelog update).
3
- First you need to install bumpversion using pip::
4
-
5
- sudo pip2 install bumpversion
6
-
7
- Then for the actual releasing:
8
-
9
- 1) After each release, a new version has to be created (in this example, the 2.7.0 dev)::
10
-
11
- python2 ./scripts/bumpversion.py newversion minor # 2.6.7 -> 2.7.0.dev
12
-
13
- 2) [work/commit]
14
- 3) **Warning:** Be sure that there is no dirty file (not committed) before
15
- doing this.
16
-
17
- Releasing a new version::
18
-
19
- python2 ./scripts/bumpversion.py release # 2.7.0.dev -> 2.7.0 + git tag + changelog
20
- gem build kameleon-builder.gemspec
21
- gem push kameleon-builder-2.7.0.gem
22
-
23
- You need a rubygem account and I have to give you permissions so that you can push.
24
- To do so, create an account on https://rubygems.org/ and ask an owner to do
25
- the following command::
26
-
27
- gem owner kameleon-builder -a your@email.com
28
-
29
- And that's all :)