Révision ece9be27
Do PDK convert
Rakefile | ||
---|---|---|
1 |
# frozen_string_literal: true |
|
2 |
|
|
3 |
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any? |
|
1 | 4 |
require 'puppetlabs_spec_helper/rake_tasks' |
2 | 5 |
require 'puppet-syntax/tasks/puppet-syntax' |
3 | 6 |
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? |
... | ... | |
14 | 17 |
|
15 | 18 |
def changelog_project |
16 | 19 |
return unless Rake.application.top_level_tasks.include? "changelog" |
17 |
returnVal = nil || JSON.load(File.read('metadata.json'))['name'] |
|
18 |
raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil? |
|
20 |
|
|
21 |
returnVal = nil |
|
22 |
returnVal ||= begin |
|
23 |
metadata_source = JSON.load(File.read('metadata.json'))['source'] |
|
24 |
metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z}) |
|
25 |
|
|
26 |
metadata_source_match && metadata_source_match[1] |
|
27 |
end |
|
28 |
|
|
29 |
raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil? |
|
30 |
|
|
19 | 31 |
puts "GitHubChangelogGenerator project:#{returnVal}" |
20 | 32 |
returnVal |
21 | 33 |
end |
22 | 34 |
|
23 | 35 |
def changelog_future_release |
24 | 36 |
return unless Rake.application.top_level_tasks.include? "changelog" |
25 |
returnVal = JSON.load(File.read('metadata.json'))['version'] |
|
37 |
returnVal = "v%s" % JSON.load(File.read('metadata.json'))['version']
|
|
26 | 38 |
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil? |
27 | 39 |
puts "GitHubChangelogGenerator future_release:#{returnVal}" |
28 | 40 |
returnVal |
... | ... | |
40 | 52 |
config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)." |
41 | 53 |
config.add_pr_wo_labels = true |
42 | 54 |
config.issues = false |
43 |
config.merge_prefix = "### UNCATEGORIZED PRS; GO LABEL THEM"
|
|
55 |
config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
|
|
44 | 56 |
config.configure_sections = { |
45 | 57 |
"Changed" => { |
46 | 58 |
"prefix" => "### Changed", |
... | ... | |
48 | 60 |
}, |
49 | 61 |
"Added" => { |
50 | 62 |
"prefix" => "### Added", |
51 |
"labels" => ["feature", "enhancement"],
|
|
63 |
"labels" => ["enhancement", "feature"],
|
|
52 | 64 |
}, |
53 | 65 |
"Fixed" => { |
54 | 66 |
"prefix" => "### Fixed", |
55 |
"labels" => ["bugfix"], |
|
67 |
"labels" => ["bug", "documentation", "bugfix"],
|
|
56 | 68 |
}, |
57 | 69 |
} |
58 | 70 |
end |
... | ... | |
60 | 72 |
desc 'Generate a Changelog from GitHub' |
61 | 73 |
task :changelog do |
62 | 74 |
raise <<EOM |
63 |
The changelog tasks depends on unreleased features of the github_changelog_generator gem.
|
|
75 |
The changelog tasks depends on recent features of the github_changelog_generator gem.
|
|
64 | 76 |
Please manually add it to your .sync.yml for now, and run `pdk update`: |
65 | 77 |
--- |
66 | 78 |
Gemfile: |
67 | 79 |
optional: |
68 | 80 |
':development': |
69 | 81 |
- gem: 'github_changelog_generator' |
70 |
git: 'https://github.com/skywinder/github-changelog-generator' |
|
71 |
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' |
|
72 |
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')" |
|
82 |
version: '~> 1.15' |
|
83 |
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')" |
|
73 | 84 |
EOM |
74 | 85 |
end |
75 | 86 |
end |
87 |
|
Formats disponibles : Unified diff