Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / Rakefile @ 647b2d5c

Historique | Voir | Annoter | Télécharger (2,36 ko)

1 5fea281f Tim
# Managed by modulesync - DO NOT EDIT
2
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
3
4 20eaf3c2 Tim
# Attempt to load voxpupuli-test (which pulls in puppetlabs_spec_helper),
5 78f22811 Steve Traylen
# otherwise attempt to load it directly.
6
begin
7
  require 'voxpupuli/test/rake'
8
rescue LoadError
9 5fea281f Tim
  begin
10
    require 'puppetlabs_spec_helper/rake_tasks'
11
  rescue LoadError
12
  end
13
end
14
15
# load optional tasks for acceptance
16
# only available if gem group releases is installed
17
begin
18
  require 'voxpupuli/acceptance/rake'
19
rescue LoadError
20 186a64ca tr
end
21
22 78f22811 Steve Traylen
# load optional tasks for releases
23
# only available if gem group releases is installed
24
begin
25
  require 'voxpupuli/release/rake_tasks'
26
rescue LoadError
27
end
28 ece9be27 tr
29 78f22811 Steve Traylen
desc "Run main 'test' task and report merged results to coveralls"
30
task test_with_coveralls: [:test] do
31
  if Dir.exist?(File.expand_path('../lib', __FILE__))
32
    require 'coveralls/rake/task'
33
    Coveralls::RakeTask.new
34
    Rake::Task['coveralls:push'].invoke
35
  else
36
    puts 'Skipping reporting to coveralls.  Module has no lib dir'
37 ece9be27 tr
  end
38 186a64ca tr
end
39
40 78f22811 Steve Traylen
desc 'Generate REFERENCE.md'
41
task :reference, [:debug, :backtrace] do |t, args|
42
  patterns = ''
43
  Rake::Task['strings:generate:reference'].invoke(patterns, args[:debug], args[:backtrace])
44 186a64ca tr
end
45
46 78f22811 Steve Traylen
begin
47
  require 'github_changelog_generator/task'
48
  require 'puppet_blacksmith'
49 186a64ca tr
  GitHubChangelogGenerator::RakeTask.new :changelog do |config|
50 5fea281f Tim
    metadata = Blacksmith::Modulefile.new
51
    config.future_release = "v#{metadata.version}" if metadata.version =~ /^\d+\.\d+.\d+$/
52 78f22811 Steve Traylen
    config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file.\nEach new release typically also includes the latest modulesync defaults.\nThese should not affect the functionality of the module."
53
    config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog}
54
    config.user = 'voxpupuli'
55 404e2017 Tim Meusel
    config.project = 'puppet-nftables'
56 186a64ca tr
  end
57 78f22811 Steve Traylen
58
  # Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715
59
  require 'rbconfig'
60
  if RbConfig::CONFIG['host_os'] =~ /linux/
61
    task :changelog do
62
      puts 'Fixing line endings...'
63
      changelog_file = File.join(__dir__, 'CHANGELOG.md')
64
      changelog_txt = File.read(changelog_file)
65
      new_contents = changelog_txt.gsub(%r{\r\n}, "\n")
66
      File.open(changelog_file, "w") {|file| file.puts new_contents }
67
    end
68 186a64ca tr
  end
69 ece9be27 tr
70 78f22811 Steve Traylen
rescue LoadError
71
end
72
# vim: syntax=ruby