This repository has been archived by the owner on Aug 7, 2020. It is now read-only.
forked from voxpupuli/puppet-jenkins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
51 lines (42 loc) · 1.39 KB
/
Rakefile
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
39
40
41
42
43
44
45
46
47
48
49
50
51
require 'rake'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
require 'puppetlabs_spec_helper/rake_tasks'
task :default => [:spec]
desc "Check puppet manifests with puppet-lint"
task :lint do
linter = "puppet-lint --with-filename --no-80chars-check"
sh "#{linter} manifests"
sh "#{linter} tests"
end
desc "Build package"
task :build do
sh 'puppet-module build'
end
Cucumber::Rake::Task.new do |t|
t.cucumber_opts = ['--color', '--format pretty', '--format junit -o test_reports']
end
desc "Run the full integration test suite (slow!)"
task :integration => [:lint, :spec, :build, :cucumber]
namespace :spec do
desc "Make sure some of the rspec-puppet directories/files are in place"
task :check do
dot_puppet = File.expand_path('~/.puppet')
unless File.exists?(dot_puppet) and File.directory?(dot_puppet)
puts 'rspec-puppet needs a ~/.puppet directory to run properly'
puts
puts 'I\'ll go ahead and make one for you'
Dir.mkdir(dot_puppet)
puts
end
unless File.exists?(File.join(dot_puppet, '/manifests/site.pp'))
puts 'rspec puppet needs (dummy) ~/.puppet/manifests/site.pp file to run properly'
puts
puts 'I\'ll go ahead and make one for you'
Dir.mkdir(File.join(dot_puppet, '/manifests'))
File.open(File.join(dot_puppet, '/manifests/site.pp'), 'w') do |fd|
fd.write('')
end
end
end
end