Skip to content

Commit

Permalink
Include elasticsearch-xpack changes in CHANGELOG as part of update_ve…
Browse files Browse the repository at this point in the history
…rson rake task
  • Loading branch information
estolfo committed Mar 13, 2019
1 parent 57fe5c2 commit f475266
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ task :update_version, :old, :new do |task, args|
log_entries[:api] = log.select { |l| l =~ /\[API\]/ }
log_entries[:dsl] = log.select { |l| l =~ /\[DSL\]/ }
log_entries[:ext] = log.select { |l| l =~ /\[EXT\]/ }
log_entries[:xpack] = log.select { |l| l =~ /\[XPACK\]/ }

changelog = File.read(File.open('CHANGELOG.md', 'r'))

Expand Down Expand Up @@ -187,6 +188,15 @@ task :update_version, :old, :new do |task, args|
changelog_update << "\n\n"
end

unless log_entries[:xpack].empty?
changelog_update << "## XPACK:#{args[:new]}\n\n"
changelog_update << log_entries[:xpack]
.map { |l| l.gsub /\[XPACK\] /, '' }
.map { |l| "#{l}" }
.join("\n")
changelog_update << "\n\n"
end

File.open('CHANGELOG.md', 'w+') { |f| f.write changelog_update and f.write changelog }

puts "\n\n", "= DIFF ".ansi(:faint) + ('='*93).ansi(:faint)
Expand Down

0 comments on commit f475266

Please sign in to comment.