cookbook-release 2.0.0 → 2.0.2

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: 629cb7b2301b4598ac3df2bec55c94e0ee7359196ecc91033e398dffadc374b1
4
- data.tar.gz: 5a961bd3cafc52049e80401424f1ea36e7982f274279ee1cdf5f73ec931f6532
3
+ metadata.gz: 401f2dff87d778073ac223de55afb29e6aab7559a9864a8b6109e10026223f7d
4
+ data.tar.gz: fbdba293a7a91946690eb7536f632fe66327f38b875a2c887d1369d403c0fda1
5
5
  SHA512:
6
- metadata.gz: 6aa94e1a75d10392075fed059d82f27762e196e0525b3c441d6c92b031112de4a6a925850663b70988eeaa7ec218894ca0f474a6f812b6aa4154fb4f7421e4fe
7
- data.tar.gz: a2a9eca39cef781c24826f662235cc21f353f66dfeb1a721ca43225755f95b466b9db5a5ded003acde5531ff4f3cb646053b8ed3e9ee0012cc86c1b877c1b83f
6
+ metadata.gz: 1150bb9411bca0d001e3c77c261a67a7839d4751ec395d69abac3b5cc97f2aea606f2f8d9b3956828a07e7420efa87d4d632f13e17c8526d8ed04b97cbf72577
7
+ data.tar.gz: 7629f75dde90292635992a67d5028a8daef064eddb6e987291824b5c0e1d54941e5f9d4efe855b03bee4935ff4f435313fd6204204ae53bbf662aca0ac4abea5
@@ -1,11 +1,15 @@
1
1
  name: Tests
2
- on: [push, pull_request]
2
+ on:
3
+ push:
4
+ branches: [ master ]
5
+ pull_request:
6
+ branches: [ master ]
3
7
  jobs:
4
8
  test:
5
9
  runs-on: ubuntu-latest
6
10
  strategy:
7
11
  matrix:
8
- ruby-version: ['2.7']
12
+ ruby-version: ['3.3']
9
13
  steps:
10
14
  - uses: actions/checkout@v2
11
15
  - uses: ruby/setup-ruby@v1
data/README.md CHANGED
@@ -44,7 +44,7 @@ version ::CookbookRelease::Release.current_version(__FILE__)
44
44
  Include the rake tasks in your Rakefile:
45
45
 
46
46
  ```
47
- require 'cookbook-release'
47
+ require 'cookbook-release/rake_tasks'
48
48
  CookbookRelease::Rake::CookbookTask.new
49
49
  ```
50
50
 
@@ -74,7 +74,7 @@ Changelog generation for chef-repositories
74
74
 
75
75
  Using:
76
76
  ```
77
- require 'cookbook-release'
77
+ require 'cookbook-release/rake_tasks'
78
78
  CookbookRelease::Rake::RepoTask.new
79
79
  ```
80
80
 
@@ -6,7 +6,7 @@ require 'English'
6
6
 
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = 'cookbook-release'
9
- spec.version = '2.0.0'
9
+ spec.version = '2.0.2'
10
10
  spec.authors = ['Grégoire Seux']
11
11
  spec.email = 'g.seux@criteo.com'
12
12
  spec.summary = 'Provide primitives (and rake tasks) to release a cookbook'
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency 'mixlib-shellout'
25
25
  spec.add_dependency 'chef', '>= 17'
26
26
  spec.add_dependency 'knife', '>= 17'
27
- spec.add_dependency 'git'
27
+ spec.add_dependency 'git', '~> 4.0'
28
28
  spec.add_dependency 'unicode-emoji'
29
29
 
30
30
 
@@ -77,7 +77,7 @@ module CookbookRelease
77
77
 
78
78
  def compute_changelog(since, short_sha = true)
79
79
  ref = "#{@tag_prefix}#{since}"
80
- @g.log(500).object(@sub_dir).between(ref, 'HEAD').map do |commit|
80
+ @g.log(500).object(@sub_dir).between(ref, 'HEAD').execute.map do |commit|
81
81
  message = commit.message.lines.map(&:chomp).compact.delete_if(&:empty?)
82
82
  Commit.new(
83
83
  author: commit.author.name,
@@ -0,0 +1,107 @@
1
+ require 'rake'
2
+ require 'rake/tasklib'
3
+ require_relative 'changelog'
4
+ require_relative 'git-utilities'
5
+ require_relative 'release'
6
+
7
+ module CookbookRelease
8
+ module Rake
9
+
10
+ class RepoTask < ::Rake::TaskLib
11
+ def initialize(opts = {}, &html_block)
12
+ desc 'Display raw changelog between branches'
13
+ task 'changelog:raw', [:sub_dir] do |_, args|
14
+ git = GitUtilities.new('sub_dir': args['sub_dir'])
15
+ puts Changelog.new(git, opts).raw
16
+ end
17
+
18
+ desc 'Display raw changelog between branches with risky commits on top'
19
+ task 'changelog:raw_priority', [:sub_dir] do |_, args|
20
+ git = GitUtilities.new(args)
21
+ git = GitUtilities.new('sub_dir': args['sub_dir'])
22
+ puts Changelog.new(git, opts).raw_priority
23
+ end
24
+
25
+ desc 'Display html changelog between branches'
26
+ task 'changelog:html', [:sub_dir] do |_, args|
27
+ git = GitUtilities.new('sub_dir': args['sub_dir'])
28
+ html = Changelog.new(git, opts).html
29
+ if block_given?
30
+ html = html_block.call(html)
31
+ end
32
+ puts html
33
+ end
34
+
35
+ desc 'Display html changelog between branches with risky commits on top'
36
+ task 'changelog:html_priority', [:sub_dir] do |_, args|
37
+ git = GitUtilities.new('sub_dir': args['sub_dir'])
38
+ html = Changelog.new(git, opts).html_priority
39
+ if block_given?
40
+ html = html_block.call(html)
41
+ end
42
+ puts html
43
+ end
44
+
45
+ desc 'Display markdown changelog between branches'
46
+ task 'changelog:markdown', [:sub_dir] do |_, args|
47
+ git = GitUtilities.new('sub_dir': args['sub_dir'])
48
+ puts Changelog.new(git, opts).markdown
49
+ end
50
+
51
+ desc 'Display markdown changelog between branches with risky commits on top'
52
+ task 'changelog:markdown_priority', [:sub_dir] do |_, args|
53
+ git = GitUtilities.new('sub_dir': args['sub_dir'])
54
+ puts Changelog.new(git, opts).markdown_priority
55
+ end
56
+
57
+ desc 'Display markdown changelog between branches with risky commits on top and non-node-only changes separated'
58
+ task 'changelog:markdown_priority_nodes', [:sub_dir] do |_, args|
59
+ git = GitUtilities.new('sub_dir': args['sub_dir'])
60
+ puts Changelog.new(git, opts).markdown_priority_nodes
61
+ end
62
+ end
63
+ end
64
+
65
+ class CookbookTask < ::Rake::TaskLib
66
+
67
+ def initialize(namespaced=false)
68
+ define_tasks(namespaced)
69
+ end
70
+
71
+ def define_tasks(namespaced)
72
+
73
+ desc 'Prepare cookbook release and push tag to git'
74
+ task 'release!' do
75
+ opts = {
76
+ no_prompt: ENV['NO_PROMPT'],
77
+ category: ENV['COOKBOOK_CATEGORY'],
78
+ skip_upload: ENV['SKIP_COOKOOK_UPLOAD']
79
+ }
80
+ git = GitUtilities.new
81
+ Release.new(git, opts).release!
82
+ end
83
+
84
+ desc 'Suggest new release version'
85
+ task 'release:suggest_version' do
86
+ git = GitUtilities.new
87
+ release = Release.new(git)
88
+ release.display_suggested_version(*release.new_version)
89
+ end
90
+
91
+ desc 'Display last released version'
92
+ task 'release:version' do
93
+ git = GitUtilities.new
94
+ release = Release.new(git)
95
+ puts release.last_release
96
+ end
97
+
98
+ desc 'Display changelog since last release'
99
+ task 'release:changelog' do
100
+ git = GitUtilities.new
101
+ release = Release.new(git)
102
+ release.display_changelog(release.new_version.first)
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end
@@ -1,3 +1,7 @@
1
+ require 'highline/import'
2
+ require_relative 'git-utilities'
3
+ require_relative 'supermarket'
4
+
1
5
  module CookbookRelease
2
6
  class Release
3
7
 
@@ -3,108 +3,4 @@ require_relative 'cookbook-release/git-utilities'
3
3
  require_relative 'cookbook-release/supermarket'
4
4
  require_relative 'cookbook-release/release'
5
5
  require_relative 'cookbook-release/changelog'
6
-
7
- require 'rake'
8
- require 'rake/tasklib'
9
-
10
- module CookbookRelease
11
- module Rake
12
-
13
- class RepoTask < ::Rake::TaskLib
14
- def initialize(opts = {}, &html_block)
15
- desc 'Display raw changelog between branches'
16
- task 'changelog:raw', [:sub_dir] do |_, args|
17
- git = GitUtilities.new('sub_dir': args['sub_dir'])
18
- puts Changelog.new(git, opts).raw
19
- end
20
-
21
- desc 'Display raw changelog between branches with risky commits on top'
22
- task 'changelog:raw_priority', [:sub_dir] do |_, args|
23
- git = GitUtilities.new(args)
24
- git = GitUtilities.new('sub_dir': args['sub_dir'])
25
- puts Changelog.new(git, opts).raw_priority
26
- end
27
-
28
- desc 'Display html changelog between branches'
29
- task 'changelog:html', [:sub_dir] do |_, args|
30
- git = GitUtilities.new('sub_dir': args['sub_dir'])
31
- html = Changelog.new(git, opts).html
32
- if block_given?
33
- html = html_block.call(html)
34
- end
35
- puts html
36
- end
37
-
38
- desc 'Display html changelog between branches with risky commits on top'
39
- task 'changelog:html_priority', [:sub_dir] do |_, args|
40
- git = GitUtilities.new('sub_dir': args['sub_dir'])
41
- html = Changelog.new(git, opts).html_priority
42
- if block_given?
43
- html = html_block.call(html)
44
- end
45
- puts html
46
- end
47
-
48
- desc 'Display markdown changelog between branches'
49
- task 'changelog:markdown', [:sub_dir] do |_, args|
50
- git = GitUtilities.new('sub_dir': args['sub_dir'])
51
- puts Changelog.new(git, opts).markdown
52
- end
53
-
54
- desc 'Display markdown changelog between branches with risky commits on top'
55
- task 'changelog:markdown_priority', [:sub_dir] do |_, args|
56
- git = GitUtilities.new('sub_dir': args['sub_dir'])
57
- puts Changelog.new(git, opts).markdown_priority
58
- end
59
-
60
- desc 'Display markdown changelog between branches with risky commits on top and non-node-only changes separated'
61
- task 'changelog:markdown_priority_nodes', [:sub_dir] do |_, args|
62
- git = GitUtilities.new('sub_dir': args['sub_dir'])
63
- puts Changelog.new(git, opts).markdown_priority_nodes
64
- end
65
- end
66
- end
67
-
68
- class CookbookTask < ::Rake::TaskLib
69
-
70
- def initialize(namespaced=false)
71
- define_tasks(namespaced)
72
- end
73
-
74
- def define_tasks(namespaced)
75
-
76
- desc 'Prepare cookbook release and push tag to git'
77
- task 'release!' do
78
- opts = {
79
- no_prompt: ENV['NO_PROMPT'],
80
- category: ENV['COOKBOOK_CATEGORY'],
81
- skip_upload: ENV['SKIP_COOKOOK_UPLOAD']
82
- }
83
- git = GitUtilities.new
84
- Release.new(git, opts).release!
85
- end
86
-
87
- desc 'Suggest new release version'
88
- task 'release:suggest_version' do
89
- git = GitUtilities.new
90
- release = Release.new(git)
91
- release.display_suggested_version(*release.new_version)
92
- end
93
-
94
- desc 'Display last released version'
95
- task 'release:version' do
96
- git = GitUtilities.new
97
- release = Release.new(git)
98
- puts release.last_release
99
- end
100
-
101
- desc 'Display changelog since last release'
102
- task 'release:changelog' do
103
- git = GitUtilities.new
104
- release = Release.new(git)
105
- release.display_changelog(release.new_version.first)
106
- end
107
- end
108
- end
109
- end
110
- end
6
+ require_relative 'cookbook-release/rake_tasks'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cookbook-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grégoire Seux
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-18 00:00:00.000000000 Z
11
+ date: 2026-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semantic
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: git
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '4.0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '4.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: unicode-emoji
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -182,6 +182,7 @@ files:
182
182
  - lib/cookbook-release/changelog.rb
183
183
  - lib/cookbook-release/commit.rb
184
184
  - lib/cookbook-release/git-utilities.rb
185
+ - lib/cookbook-release/rake_tasks.rb
185
186
  - lib/cookbook-release/release.rb
186
187
  - lib/cookbook-release/supermarket.rb
187
188
  - spec/changelog_spec.rb
@@ -194,7 +195,7 @@ homepage: https://github.com/criteo/cookbook-release.git
194
195
  licenses:
195
196
  - Apache License v2
196
197
  metadata: {}
197
- post_install_message:
198
+ post_install_message:
198
199
  rdoc_options: []
199
200
  require_paths:
200
201
  - lib
@@ -210,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
211
  version: '0'
211
212
  requirements: []
212
213
  rubygems_version: 3.1.6
213
- signing_key:
214
+ signing_key:
214
215
  specification_version: 4
215
216
  summary: Provide primitives (and rake tasks) to release a cookbook
216
217
  test_files: