diff options
author | Tom Duffield <tom@chef.io> | 2016-11-04 11:19:32 -0500 |
---|---|---|
committer | Thom May <thom@may.lt> | 2016-11-04 16:19:32 +0000 |
commit | 87d5ca4a6d20f895e844672aa44b17a8ce3560af (patch) | |
tree | ec58686f39f839c535a3e125494ce948f2e60c09 /tasks | |
parent | 6de8f55208fa3e78c4342370a70c7cf00b8c3b6a (diff) | |
download | chef-87d5ca4a6d20f895e844672aa44b17a8ce3560af.tar.gz |
Update changelog generator to better fill our pattern (#5515)
* Update changelog generator to better fill our pattern
Configure the changelog generator to better fit our current pattern of
changelogs. By utilizing the HISTORY.md file, we can generate a combined
changelog of the latest version from HISTORY.md to now. Then, when we
cut a release we can simply move our current changelog into
HISTORY.md (using the appropriate rake task) and start the process over
again.
This might even be a first step to having the Chef Versioner generate
the changelog automatically for us each time it bumps the version, and
then we just need to groom it as we go along.
Signed-off-by: Tom Duffield <tom@chef.io>
* Add HISTORY.md for the 12.15.19 release
Signed-off-by: Tom Duffield <tom@chef.io>
Diffstat (limited to 'tasks')
-rw-r--r-- | tasks/changelog.rb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/tasks/changelog.rb b/tasks/changelog.rb index 15f56c53ee..6dd1ba58ae 100644 --- a/tasks/changelog.rb +++ b/tasks/changelog.rb @@ -1,13 +1,30 @@ begin require "github_changelog_generator/task" - GitHubChangelogGenerator::RakeTask.new :changelog do |config| - config.issues = false + # Take the current changelog and move it to HISTORY.md. Should be done when + # cutting a release + task :archive_changelog do + changelog = File.readlines("CHANGELOG.md") + File.open("HISTORY.md", "w+") { |f| f.write(changelog[2..-1].join("")) } + end + + # Run this to just update the changelog for the current release. This will + # take what is in History and generate a changelog of PRs between the most + # recent tag in HISTORY.md and HEAD. + GitHubChangelogGenerator::RakeTask.new :update_changelog do |config| config.future_release = Chef::VERSION + config.between_tags = ["v#{Chef::VERSION}"] + config.max_issues = 0 + config.add_issues_wo_labels = false config.enhancement_labels = "enhancement,Enhancement,New Feature,Feature".split(",") config.bug_labels = "bug,Bug,Improvement,Upstream Bug".split(",") config.exclude_labels = "duplicate,question,invalid,wontfix,no_changelog,Exclude From Changelog,Question,Discussion".split(",") end + + task :changelog do + Rake::Task["archive_changelog"].execute + Rake::Task["update_changelog"].execute + end rescue LoadError puts "github_changelog_generator is not available. gem install github_changelog_generator to generate changelogs" end |