diff options
author | Josh Cooper <josh@puppet.com> | 2019-10-24 09:25:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-24 09:25:30 -0700 |
commit | d8a221103a87fc3066e56f390d16c56ddf25e44d (patch) | |
tree | c54ac020dd8712d8a2235385ccd5da1e94b14b3c /Rakefile | |
parent | 0e6e663b82b12d0d5ce4f2fe0c41e6289c88efae (diff) | |
parent | cb746fccd6afce502072dccd8aa57e2f645d9d45 (diff) | |
download | puppet-cron_core-d8a221103a87fc3066e56f390d16c56ddf25e44d.tar.gz puppet-cron_core-d8a221103a87fc3066e56f390d16c56ddf25e44d.tar.bz2 |
Merge pull request #27 from puppetlabs/pdksync_update-pdk
pdksync - (maint) Update module using PDK 1.14.0
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -1,3 +1,4 @@ +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? @@ -14,15 +15,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 = "v%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 |