aboutsummaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorJacob Helwig <jacob@technosorcery.net>2018-06-25 10:49:51 -0700
committerJacob Helwig <jacob@technosorcery.net>2018-06-25 11:26:53 -0700
commitf00732c424c7535e22a31f64d1cd22d83dc76b14 (patch)
treee4f9f74eb0ecad483742b87c032940ce82dc1a4a /Rakefile
parent9a3a8bf16198197ab89430dda8bc674cbd60fcca (diff)
downloadpuppet-sshkeys_core-f00732c424c7535e22a31f64d1cd22d83dc76b14.tar.gz
puppet-sshkeys_core-f00732c424c7535e22a31f64d1cd22d83dc76b14.tar.bz2
Update PDK template
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/Rakefile b/Rakefile
index 99cbf32..a7c4d68 100644
--- a/Rakefile
+++ b/Rakefile
@@ -5,6 +5,7 @@ require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_
require 'puppet-lint/tasks/puppet-lint'
def changelog_user
+ return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = nil || JSON.load(File.read('metadata.json'))['author']
raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil?
puts "GitHubChangelogGenerator user:#{returnVal}"
@@ -12,6 +13,7 @@ def changelog_user
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?
puts "GitHubChangelogGenerator project:#{returnVal}"
@@ -19,6 +21,7 @@ def changelog_project
end
def changelog_future_release
+ return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = 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}"
@@ -29,7 +32,7 @@ PuppetLint.configuration.send('disable_relative')
if Bundler.rubygems.find_name('github_changelog_generator').any?
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
- raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if ENV['CHANGELOG_GITHUB_TOKEN'].nil?
+ raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil?
config.user = "#{changelog_user}"
config.project = "#{changelog_project}"
config.future_release = "#{changelog_future_release}"