mirror of
https://github.com/dev-sec/linux-baseline
synced 2024-11-23 03:33:02 +00:00
16d47e8dc5
Chef 13 is also using ruby 2.4.1 in the omnibus packages Signed-off-by: Artem Sidorenko <artem@posteo.de>
39 lines
1 KiB
Ruby
39 lines
1 KiB
Ruby
require 'rake/testtask'
|
|
require 'rubocop/rake_task'
|
|
|
|
# Rubocop
|
|
desc 'Run Rubocop lint checks'
|
|
task :rubocop do
|
|
RuboCop::RakeTask.new
|
|
end
|
|
|
|
# lint the project
|
|
desc 'Run robocop linter'
|
|
task lint: [:rubocop]
|
|
|
|
# run tests
|
|
task default: [:lint, 'test:check']
|
|
|
|
namespace :test do
|
|
# run inspec check to verify that the profile is properly configured
|
|
task :check do
|
|
dir = File.join(File.dirname(__FILE__))
|
|
sh("bundle exec inspec check #{dir}")
|
|
end
|
|
end
|
|
|
|
# Automatically generate a changelog for this project. Only loaded if
|
|
# the necessary gem is installed. By default its picking up the version from
|
|
# inspec.yml. You can override that behavior with s`rake changelog to=1.2.0`
|
|
begin
|
|
require 'yaml'
|
|
metadata = YAML.load_file('inspec.yml')
|
|
v = ENV['to'] || metadata['version']
|
|
puts "Generate changelog for version #{v}"
|
|
require 'github_changelog_generator/task'
|
|
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
|
config.future_release = v
|
|
end
|
|
rescue LoadError
|
|
puts '>>>>> GitHub Changelog Generator not loaded, omitting tasks'
|
|
end
|