forked from sue445/jenkins-backup-script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
36 lines (29 loc) · 786 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
require "rspec/core/rake_task"
task :spec => "spec:all"
HOSTS = %w(centos7 debian8 debian9)
namespace :spec do
task :all => HOSTS
HOSTS.each do |host|
RSpec::Core::RakeTask.new(host.to_sym) do |t|
puts "Running tests to #{host} ..."
ENV["TARGET_HOST"] = host
t.pattern = "spec/*_spec.rb"
end
end
end
namespace :itamae do
task :all => HOSTS
HOSTS.each do |host|
desc "Running itamae to #{host}"
task host do
sh "itamae ssh --host=#{host} --vagrant --node-yaml=spec/node.yml spec/recipes/bootstrap.rb"
end
end
end
desc "release"
task :release do
new_version = File.read("#{__dir__}/VERSION").strip
sh "git tag -a #{new_version} -m 'release #{new_version}'"
sh "git push origin master"
sh "git push origin --tags"
end