-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathRakefile
31 lines (26 loc) · 854 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
require 'rake'
require 'rspec/core/rake_task'
task spec: 'spec:all'
task default: :spec
namespace :spec do
targets = []
Dir.glob('./spec/*').each do |dir|
next unless File.directory?(dir)
target = File.basename(dir)
target = "_#{target}" if target == 'default'
targets << target
end
task all: targets
task default: :all
targets.each do |target|
original_target = target == '_default' ? target[1..-1] : target
desc "Run serverspec tests to #{original_target}"
RSpec::Core::RakeTask.new(target.to_sym) do |t|
ENV['TARGET_HOST'] = original_target
ENV['PASSBOLT_FLAVOUR'] || ENV['PASSBOLT_FLAVOUR'] = 'ce'
ENV['PASSBOLT_COMPONENT'] || ENV['PASSBOLT_COMPONENT'] = 'stable'
ENV['ROOTLESS'] || ENV['ROOTLESS'] = 'false'
t.pattern = "spec/#{original_target}/*_spec.rb"
end
end
end