mirror of
https://github.com/inspec/inspec
synced 2024-11-28 07:30:50 +00:00
38 lines
873 B
Ruby
38 lines
873 B
Ruby
|
#!/usr/bin/env rake
|
||
|
|
||
|
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.
|
||
|
# use `rake changelog to=1.2.0`
|
||
|
begin
|
||
|
v = ENV['to']
|
||
|
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
|