-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathRakefile
More file actions
38 lines (31 loc) · 1.12 KB
/
Rakefile
File metadata and controls
38 lines (31 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# frozen_string_literal: true
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet-lint/tasks/puppet-lint'
require 'rubocop/rake_task'
require 'puppet-strings/tasks/generate'
Rake::Task['rubocop'].clear
RuboCop::RakeTask.new(:rubocop) do |task|
# Bug where rubocop searches paths recursivly. Ignoring this config.
task.options = ['--config', '.rubocop.yml']
end
JENKINS_TASKS = %w[syntax lint rubocop spec metadata_lint].freeze
namespace :jenkins do
task :all do
base = ENV['BUNDLE_GEMFILE'].nil? ? 'rake' : "#{ENV['BUNDLE_BIN_PATH']} exec rake"
failed_tasks = []
JENKINS_TASKS.each do |target|
# puts "Executing '#{base} #{target}'"
failed_tasks << target unless system("#{base} #{target}")
end
unless failed_tasks.empty?
warn "The following targets failed: #{failed_tasks.join(', ')}"
exit(1)
end
end
end
desc 'Run all jenkins tasks'
task jenkins: ['jenkins:all']
Rake::Task['default'].clear
task default: %i[syntax lint rubocop validate]
PuppetLint.configuration.ignore_paths = ['spec/**/*.pp', 'pkg/**/*.pp', 'vendor/**/*.pp']