Skip to content

Commit 060fd1d

Browse files
committed
update Rakefile
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
1 parent fc321f7 commit 060fd1d

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

Rakefile

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env rake
2-
# encoding: utf-8
31
# frozen_string_literal: true
42

53
require 'rake/testtask'
@@ -21,23 +19,30 @@ task default: [:lint, 'test:check']
2119
namespace :test do
2220
# run inspec check to verify that the profile is properly configured
2321
task :check do
24-
dir = File.join(File.dirname(__FILE__))
25-
sh("bundle exec inspec check #{dir}")
22+
require 'inspec'
23+
puts "Checking profile with InSpec Version: #{Inspec::VERSION}"
24+
profile = Inspec::Profile.for_target('.', backend: Inspec::Backend.create(Inspec::Config.mock))
25+
pp profile.check
2626
end
2727
end
2828

29-
# Automatically generate a changelog for this project. Only loaded if
30-
# the necessary gem is installed. By default its picking up the version from
31-
# inspec.yml. You can override that behavior with s`rake changelog to=1.2.0`
32-
begin
33-
require 'yaml'
34-
metadata = YAML.load_file('inspec.yml')
35-
v = ENV['to'] || metadata['version']
36-
puts "Generate changelog for version #{v}"
37-
require 'github_changelog_generator/task'
38-
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
39-
config.future_release = v
29+
task :changelog do
30+
# Automatically generate a changelog for this project. Only loaded if
31+
# the necessary gem is installed. By default its picking up the version from
32+
# inspec.yml. You can override that behavior with `rake changelog to=1.2.0`
33+
begin
34+
require 'yaml'
35+
metadata = YAML.load_file('inspec.yml')
36+
v = ENV['to'] || metadata['version']
37+
puts " * Generating changelog for version #{v}"
38+
require 'github_changelog_generator/task'
39+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
40+
config.future_release = v
41+
config.user = 'dev-sec'
42+
config.project = 'php-baseline'
43+
end
44+
Rake::Task[:changelog].execute
45+
rescue LoadError
46+
puts '>>>>> GitHub Changelog Generator not loaded, omitting tasks'
4047
end
41-
rescue LoadError
42-
puts '>>>>> GitHub Changelog Generator not loaded, omitting tasks'
4348
end

0 commit comments

Comments
 (0)