-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
27 lines (23 loc) · 731 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
require 'rake'
require 'rspec/core/rake_task'
require_relative 'lib/devenv_setup/io'
namespace :spec do
targets = Dir.glob('./spec/*').map do |dir|
next unless File.directory?(dir)
File.basename(dir)
end.reject(&:nil?)
targets.each do |target|
desc "Run serverspec tests to #{target}"
RSpec::Core::RakeTask.new(:spec) do |t|
ENV['TARGET_HOST'] = target
t.pattern = "spec/#{target}/*_spec.rb"
end
end
end
desc 'Provision the Vagrant machine'
task :provision do
DevenvSetup::IO.pipe_to_stdout('vagrant up')
DevenvSetup::IO.pipe_to_stdout('vagrant ssh -c "cd /vagrant && sudo ./install.sh"')
end
desc 'Provision the machine and run the tests'
task :default => [:provision, 'spec:spec']