forked from techish-io/ci.chef.wlp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
43 lines (31 loc) · 821 Bytes
/
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
require 'rake/clean'
sandbox_dir = ".sandbox"
CLEAN.include(sandbox_dir)
task :default => :all
task :all => [:knife_test, :foodcritic, :rspec]
task :syntax => :knife_test
desc "Runs 'knife cookbook test'"
task :knife_test do
sh "bundle exec knife cookbook test -o .. #{cookbook_name}"
end
desc "Runs 'foodcritic'"
task :foodcritic do
sh "bundle exec foodcritic ."
end
desc "Runs 'rspec'"
task :rspec do
cookbooks_path = "#{sandbox_dir}/cookbooks"
sh "bundle exec berks vendor #{cookbooks_path}"
sh "bundle exec rspec #{cookbooks_path}/wlp/spec"
end
desc "Runs 'kitchen test'"
task :kitchen do
sh "bundle exec kitchen test"
end
desc "Runs 'knife cookbook doc'"
task :doc do
sh "bundle exec knife cookbook doc ../#{cookbook_name}"
end
def cookbook_name
File.basename(File.dirname(__FILE__))
end