aboutsummaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authormihaibuzgau <mihai.buzgau@puppet.com>2020-02-06 18:15:09 +0200
committermihaibuzgau <mihai.buzgau@puppet.com>2020-02-10 19:36:42 +0200
commit49f1083b97e7cd4561fa24268e50950a7fb1ee25 (patch)
tree51cc82a2990998349d96d08a36dd5ab742d3d996 /Rakefile
parent8adb9a19188208aa76c4116ec0ca0c4446c3d301 (diff)
downloadpuppet-mailalias_core-49f1083b97e7cd4561fa24268e50950a7fb1ee25.tar.gz
puppet-mailalias_core-49f1083b97e7cd4561fa24268e50950a7fb1ee25.tar.bz2
(maint) update to PDK 1.16.0
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile18
1 files changed, 15 insertions, 3 deletions
diff --git a/Rakefile b/Rakefile
index 2d60dbb..79e935e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,3 +1,6 @@
+# frozen_string_literal: true
+
+require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
@@ -15,15 +18,24 @@ end
def changelog_project
return unless Rake.application.top_level_tasks.include? "changelog"
- returnVal = nil || JSON.load(File.read('metadata.json'))['name']
- raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil?
+
+ returnVal = nil
+ returnVal ||= begin
+ metadata_source = JSON.load(File.read('metadata.json'))['source']
+ metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z})
+
+ metadata_source_match && metadata_source_match[1]
+ end
+
+ raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil?
+
puts "GitHubChangelogGenerator project:#{returnVal}"
returnVal
end
def changelog_future_release
return unless Rake.application.top_level_tasks.include? "changelog"
- returnVal = JSON.load(File.read('metadata.json'))['version']
+ returnVal = "%s" % JSON.load(File.read('metadata.json'))['version']
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil?
puts "GitHubChangelogGenerator future_release:#{returnVal}"
returnVal