Debian Codegraph @

Rakefile

raw
1 # This file is managed centrally by modulesync
2 # https://github.com/theforeman/foreman-installer-modulesync
3
4 require 'puppetlabs_spec_helper/rake_tasks'
5 require 'puppet-lint/tasks/puppet-lint'
6
7 # blacksmith isn't always present, e.g. on Travis with --without development
8 begin
9 require 'puppet_blacksmith/rake_tasks'
10 Blacksmith::RakeTask.new do |t|
11 t.tag_pattern = "%s"
12 t.tag_message_pattern = "Version %s"
13 t.tag_sign = true
14 end
15 rescue LoadError
16 end
17
18 begin
19 require 'github_changelog_generator/task'
20
21 # https://github.com/github-changelog-generator/github-changelog-generator/issues/313
22 module GitHubChangelogGeneratorExtensions
23 def compound_changelog
24 super.gsub(/(fixes|fixing|refs) \\#(\d+)/i, '\1 [\\#\2](https://projects.theforeman.org/issues/\2)')
25 end
26 end
27
28 class GitHubChangelogGenerator::Generator
29 prepend GitHubChangelogGeneratorExtensions
30 end
31
32 GitHubChangelogGenerator::RakeTask.new :changelog do |config|
33 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?
34 metadata = JSON.load(File.read('metadata.json'))
35 config.user = 'theforeman'
36 config.project = "puppet-#{metadata['name'].split('-').last}"
37 config.future_release = metadata['version']
38 config.exclude_labels = ['duplicate', 'question', 'invalid', 'wontfix', 'Modulesync', 'skip-changelog']
39 end
40 rescue LoadError
41 end
42
43 PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "vendor/**/*.pp"]
44 PuppetLint.configuration.log_format = '%{path}:%{line}:%{KIND}: %{message}'
45
46 require 'puppet-lint-param-docs/tasks'
47 PuppetLintParamDocs.define_selective do |config|
48 config.pattern = ["manifests/init.pp"]
49 end
50
51 require 'kafo_module_lint/tasks'
52 KafoModuleLint::RakeTask.new do |config|
53 config.pattern = ["manifests/init.pp"]
54 end
55
56 task :default => [:release_checks]