summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Duffield <tom@chef.io>2016-11-04 10:31:19 -0500
committerTom Duffield <tom@chef.io>2016-11-04 10:31:19 -0500
commit311606143df195df5e1c67bbf179c05336e0f809 (patch)
treeea9b718ca394ae39313f79ee9738c1a1e6d33edb
parenta155e20e796e16902498634efe9798b135395d9a (diff)
downloadchef-311606143df195df5e1c67bbf179c05336e0f809.tar.gz
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>
-rw-r--r--tasks/changelog.rb21
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