Rakefile in kitchen-pester-0.8.0 vs Rakefile in kitchen-pester-0.9.0

- old
+ new

@@ -7,46 +7,53 @@ t.libs.push "lib" t.test_files = FileList["spec/**/*_spec.rb"] t.verbose = true end -desc "Run all test suites" -task :test => [:unit] +task test: :unit -desc "Display LOC stats" -task :stats do - puts "\n## Production Code Stats" - sh "countloc -r lib" - puts "\n## Test Code Stats" - sh "countloc -r spec" +begin + require "chefstyle" + require "rubocop/rake_task" + RuboCop::RakeTask.new(:style) do |task| + task.options += ["--display-cop-names", "--no-color"] + end +rescue LoadError + puts "chefstyle is not available. (sudo) gem install chefstyle to do style checking." end -require "finstyle" -require "rubocop/rake_task" -RuboCop::RakeTask.new(:style) do |task| - task.options << "--display-cop-names" - task.options << "--lint" - task.options << '--config' << '.rubocop.yml' - task.patterns = ['lib/**/*.rb'] -end +desc "Run all quality tasks" +task quality: :style -require "cane/rake_task" -desc "Run cane to check quality metrics" -Cane::RakeTask.new do |cane| - cane.canefile = "./.cane" +begin + require "yard" + YARD::Rake::YardocTask.new +rescue LoadError + puts "yard is not available. (sudo) gem install yard to generate yard documentation." end -desc "Run all quality tasks" -task :quality => [:cane, :style, :stats] +task default: %i{test quality} -require "yard" -YARD::Rake::YardocTask.new +begin + require "github_changelog_generator/task" + require "kitchen/verifier/pester_version" -desc "Generate gem dependency graph" -task :viz do - Bundler.with_clean_env do - sh "bundle viz --without test development guard " \ - "--requirements --version" + GitHubChangelogGenerator::RakeTask.new :changelog do |config| + config.future_release = "v#{Kitchen::Verifier::PESTER_VERSION}" + config.issues = false + config.pulls = true + config.user = "test-kitchen" + config.project = "kitchen-pester" end +rescue LoadError + puts "github_changelog_generator is not available." \ + " (sudo) gem install github_changelog_generator to generate changelogs" end -task :default => [:test, :quality] +namespace :docs do + desc "Deploy docs" + task :deploy do + sh "cd docs && hugo" + sh "aws --profile chef-cd s3 sync docs/public s3://test-kitchen-legacy.cd.chef.co --delete --acl public-read" + sh "aws --profile chef-cd cloudfront create-invalidation --distribution-id EQD8MRW086SRT --paths '/*'" + end +end