-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
29 lines (25 loc) · 833 Bytes
/
Rakefile
File metadata and controls
29 lines (25 loc) · 833 Bytes
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
desc "Install Gems"
task :install_gems do
sh "bundle install"
end
desc "Run tests"
task :run_tests do
sh "rspec --format doc"
sh "cucumber"
end
desc "Install precommit hook"
task :install_precommit_hook do
curr_dir = File.dirname(__FILE__)
sh "cp -r #{curr_dir}/lib/hooks/* #{curr_dir}/.git/hooks/"
sh "rm -f #{curr_dir}/.git/hooks/helper/test.rb"
puts "Installed Precommit hook for puppet"
end
desc "Default task"
task :default => [:install_gems,:run_tests]
desc "Install Precommit hook to a different git repo"
task :install_precommit_hook_to, :other_git_repo do |t,args|
curr_dir = File.dirname(__FILE__)
sh "cp -r #{curr_dir}/lib/hooks/* #{args[:other_git_repo]}/.git/hooks"
sh "rm -f #{args[:other_git_repo]}/.git/hooks/helper/test.rb"
puts "Installed Precommit hook for puppet at #{args[:other_git_repo]}"
end