forked from uzyexe/chef-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
41 lines (34 loc) · 971 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
task :default => "run:osx"
desc "Install rubygems and third-paty Chef cookbooks"
task :init => [:bundle, :berks]
desc "Install rubygems"
task :bundle do
sh "gem install bundler"
sh "bundle --path vendor/bundle --binstubs .bundle/bin"
end
desc "Install third-paty Chef cookbooks"
task :berks do
sh ".bundle/bin/berks vendor cookbooks"
end
namespace :run do
desc "Run at OSX environment"
task :osx do
sh "brew cask install --force adobe-reader"
sh "chef-solo -c config/solo.rb -j nodes/osx.json"
end
desc "Run at Linux environment"
task :linux do
sh "chef-solo -c config/solo.rb -j nodes/linux.json"
end
end
namespace :cookbook do
desc "Generate cookbook at site-cookbooks; (ex: rake cookbook:create name=helloworld)"
task :create do
name = ENV["name"]
sh "knife cookbook create #{name} -o site-cookbooks"
end
desc "Validate cookbooks at sitte-cookbooks"
task :validate do
sh "foodcritic site-cookbooks"
end
end