summaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
authorTom Duffield <tom@chef.io>2016-12-02 08:25:00 -0600
committerTom Duffield <tom@chef.io>2016-12-02 08:55:38 -0600
commitdbdd18650028e10822aaf10f3f4704244b7d1d8e (patch)
tree8b8f33589b34591dd12d74429e05b71994dab897 /tasks
parent88269ebd629775c625b121709991ebc76d9c0fa4 (diff)
downloadchef-dbdd18650028e10822aaf10f3f4704244b7d1d8e.tar.gz
Use tduffield branch of github-changelog-generator
This branch fixes a number of bugs in the changelog generator, and supports the type of behavior that we want when generating our changelog. There is a PR open against upstream (skywinder/github-changelog-generator#453) to merge this upstream. As part of this, we can now generate the changelog on every commit. Signed-off-by: Tom Duffield <tom@chef.io>
Diffstat (limited to 'tasks')
-rw-r--r--tasks/changelog.rb21
1 files changed, 12 insertions, 9 deletions
diff --git a/tasks/changelog.rb b/tasks/changelog.rb
index 989c43845d..5f2648bad1 100644
--- a/tasks/changelog.rb
+++ b/tasks/changelog.rb
@@ -1,26 +1,29 @@
begin
require "github_changelog_generator/task"
+ require "mixlib/install"
namespace :changelog do
- # Take the current changelog and move it to HISTORY.md. Removes lines that
- # would get duplicated the next time we pull HISTORY into the CHANGELOG.
+ # Fetch the latest version from mixlib-install
+ latest_stable_version = Mixlib::Install.available_versions("chef", "stable").last
+
+ # Take the changelog from the latest stable release and put it into history.
task :archive do
- changelog = File.readlines("CHANGELOG.md")
- File.open("HISTORY.md", "w+") { |f| f.write(changelog[2..-4].join("")) }
+ changelog = Net::HTTP.get(URI("https://raw.githubusercontent.com/chef/chef/v#{latest_stable_version}/CHANGELOG.md")).chomp.split("\n")
+ File.open("HISTORY.md", "w+") { |f| f.write(changelog[2..-4].join("\n")) }
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.
+ # take what is in HISTORY and generate a changelog of PRs between the most
+ # recent stable version and HEAD.
GitHubChangelogGenerator::RakeTask.new :update do |config|
- config.future_release = Chef::VERSION
- config.between_tags = ["v#{Chef::VERSION}"]
+ config.future_release = "v#{Chef::VERSION}"
+ config.between_tags = ["v#{latest_stable_version}", "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(",")
- config.header = "This changelog reflects the current state of chef's master branch on github and may not reflect the current released version of chef, which is [![Gem Version](https://badge.fury.io/rb/chef.svg)](https://badge.fury.io/rb/chef)"
+ config.header = "This changelog reflects the current state of chef's master branch on github and may not reflect the current released version of chef, which is **#{latest_stable_version}**."
end
end