serverspec_launcher 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c803b0ad66ac19e9a588354b06b427be4d31dbb7
|
4
|
+
data.tar.gz: b3e7579d567e7a8c18fd13b286f32f790074e685
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93c5dbfce705a2d8e64b5a06834a350c63c38be342cd8d887efc24ff5219ff4279969cb9ee501df816aba62483356669f9ec2f0bf199507eab0254a2c7921fea
|
7
|
+
data.tar.gz: 6a53bf73f7b7c78910c808c630fe52e8403ef1072445e96e8c7b63cb3364097990237ea69e1e285e32d202c068c217bbd32e9de88c29978aa63f4a84bc3d6551
|
@@ -16,6 +16,7 @@ class ServerspecLauncherRakeTasks
|
|
16
16
|
@properties = properties ? properties : YAML.load_file('properties.yml')
|
17
17
|
options = @properties[:options] || {}
|
18
18
|
@fail_on_err = options[:fail_on_err] || true
|
19
|
+
@junit_reports = options[:fail_on_err] || true
|
19
20
|
end
|
20
21
|
|
21
22
|
def load_tasks
|
@@ -27,43 +28,45 @@ class ServerspecLauncherRakeTasks
|
|
27
28
|
task all: @properties[:targets].keys.map { |key| 'serverspec:' + key.split('.')[0] }
|
28
29
|
@properties[:targets].keys.each do |key|
|
29
30
|
target = @properties[:targets][key]
|
30
|
-
|
31
|
+
options = {
|
32
|
+
fail_on_err: target[:fail_on_err] || @fail_on_err
|
33
|
+
}
|
31
34
|
spec_type = target[:spec_type] || 'default'
|
32
35
|
if target[:hosts].is_a?(Array)
|
33
36
|
|
34
|
-
task_array(key, spec_type, target,
|
37
|
+
task_array(key, spec_type, target, options)
|
35
38
|
elsif target[:hosts]
|
36
39
|
host = target[:hosts]
|
37
40
|
task_name = (key || target[:name]).to_s
|
38
|
-
rake_task(host, key, task_name, spec_type,
|
41
|
+
rake_task(host, key, task_name, spec_type, options)
|
39
42
|
else
|
40
43
|
task_name = (key || target[:name]).to_s
|
41
|
-
rake_task(key, key, task_name, spec_type,
|
44
|
+
rake_task(key, key, task_name, spec_type, options)
|
42
45
|
end
|
43
46
|
end
|
44
47
|
end
|
45
48
|
end
|
46
49
|
|
47
|
-
def task_array(key, spec_type, target,
|
50
|
+
def task_array(key, spec_type, target, options)
|
48
51
|
desc "Run serverspec to #{key}"
|
49
52
|
task key.to_sym => "serverspec:#{key}:all"
|
50
53
|
namespace key.to_sym do
|
51
54
|
task all: target[:hosts].map { |host| "serverspec:#{key}:#{host.split('.')[0].to_sym}" }
|
52
55
|
target[:hosts].each do |host|
|
53
56
|
task_name = "#{key}:#{host || target[:name]}"
|
54
|
-
rake_task(host, key, task_name, spec_type,
|
57
|
+
rake_task(host, key, task_name, spec_type, options)
|
55
58
|
end
|
56
59
|
end
|
57
60
|
end
|
58
61
|
|
59
|
-
def rake_task(host, key, task_name, spec_type,
|
62
|
+
def rake_task(host, key, task_name, spec_type, options = {})
|
60
63
|
desc "Run serverspec to #{key}"
|
61
64
|
RSpec::Core::RakeTask.new(host.split('.')[0].to_sym) do |t|
|
62
65
|
ENV['TARGET_HOST'] = host
|
63
66
|
ENV['TARGET'] = key
|
64
67
|
ENV['TASK_NAME'] = task_name
|
65
68
|
t.pattern = "spec/#{spec_type}_spec.rb"
|
66
|
-
t.fail_on_error = false unless fail_on_err
|
69
|
+
t.fail_on_error = false unless options[:fail_on_err]
|
67
70
|
end
|
68
71
|
end
|
69
72
|
|