reagan 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reagan/config.rb +12 -12
- data/lib/reagan/test_json.rb +1 -1
- data/lib/reagan/test_knife.rb +1 -1
- data/lib/reagan/test_reagan.rb +1 -1
- data/lib/reagan/test_version.rb +1 -1
- data/lib/reagan.rb +1 -0
- data/reagan.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82b26aac734f61733db7108f0987c104cf5f00eb
|
4
|
+
data.tar.gz: 93867b5e5b4889286c1a38a910ef8d741fd7b1d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c02e7bb3ddfa4d14fcde1a0c6d7ec34ea96cf70e43efcb74475d7625d7978e768a8c4d2d8915d06b053e0d1ca2cfd285de69cd1ce64f56be99124f334562314
|
7
|
+
data.tar.gz: b03136abd428f35af38207375daa2a30f05fd46009d6a12411dd2c3c73f5b8a3c6cedfeef14cf410fe3c4aa8bb866fbd42a033726630bcd7c3fad3724de40cb2
|
data/lib/reagan/config.rb
CHANGED
@@ -96,7 +96,7 @@ module Reagan
|
|
96
96
|
|
97
97
|
# make sure the config was properly loaded and contains the various keys we need
|
98
98
|
def self::validate
|
99
|
-
settings = Config.
|
99
|
+
settings = Config.settings
|
100
100
|
|
101
101
|
if settings == false
|
102
102
|
puts "ERROR: Reagan config at #{cli_flags['config']} does not contain any configuration data".to_red
|
@@ -105,20 +105,14 @@ module Reagan
|
|
105
105
|
|
106
106
|
# make sure a pull request is specified
|
107
107
|
unless settings['flags']['pull']
|
108
|
-
puts 'Jenkins ghprbPullId environmental variable not set or --pull option not used. Cannot continue'
|
108
|
+
puts 'Jenkins ghprbPullId environmental variable not set or --pull option not used. Cannot continue'.to_red
|
109
109
|
exit 1
|
110
110
|
end
|
111
111
|
|
112
|
-
#
|
113
|
-
unless settings['jenkins'] &&
|
114
|
-
|
115
|
-
|
116
|
-
settings['jenkins'] = {}
|
117
|
-
settings['jenkins']['workspace_dir'] = workspace
|
118
|
-
else
|
119
|
-
puts 'Jenkins workspace_dir not defined in the config file and $WORKSPACE env variable empty. Exiting'.to_red
|
120
|
-
exit
|
121
|
-
end
|
112
|
+
# make sure either jenkins gave us a workspace variable or its defined in the config
|
113
|
+
unless ENV['WORKSPACE'] || (settings['jenkins'] && settings['jenkins']['workspace_dir'])
|
114
|
+
puts 'Jenkins workspace_dir not defined in the config file and $WORKSPACE env variable empty. Exiting'.to_red
|
115
|
+
exit 1
|
122
116
|
end
|
123
117
|
end
|
124
118
|
|
@@ -133,6 +127,12 @@ module Reagan
|
|
133
127
|
config['flags']['pull'] = ENV['ghprbPullId']
|
134
128
|
end
|
135
129
|
|
130
|
+
# merge in the jenkins workspace variable on top of the config file
|
131
|
+
if ENV['WORKSPACE']
|
132
|
+
config['jenkins'] = {} unless config['jenkins'] # create the higher level hash if it doesn't exist
|
133
|
+
config['jenkins']['workspace_dir'] = ENV['WORKSPACE']
|
134
|
+
end
|
135
|
+
|
136
136
|
config
|
137
137
|
end
|
138
138
|
end
|
data/lib/reagan/test_json.rb
CHANGED
@@ -36,7 +36,7 @@ module Reagan
|
|
36
36
|
rescue JSON::JSONError
|
37
37
|
success = false
|
38
38
|
end
|
39
|
-
puts success ? 'PASS: JSON parses'.indent : 'FAIL: JSON does NOT parse'.indent
|
39
|
+
puts success ? 'PASS: JSON parses'.indent : 'FAIL: JSON does NOT parse'.indent.to_red
|
40
40
|
success
|
41
41
|
end
|
42
42
|
end
|
data/lib/reagan/test_knife.rb
CHANGED
@@ -30,7 +30,7 @@ module Reagan
|
|
30
30
|
result = system "knife cookbook test -o #{File.join(Config.settings['jenkins']['workspace_dir'], 'cookbooks')} #{@cookbook} > /dev/null 2>&1"
|
31
31
|
|
32
32
|
puts 'Running knife cookbook test:'
|
33
|
-
puts result ? 'PASS: Knife cookbook test was successful'.indent : 'FAIL: Knife cookbookk test was NOT successful'.indent
|
33
|
+
puts result ? 'PASS: Knife cookbook test was successful'.indent : 'FAIL: Knife cookbookk test was NOT successful'.indent.to_red
|
34
34
|
result
|
35
35
|
end
|
36
36
|
end
|
data/lib/reagan/test_reagan.rb
CHANGED
@@ -41,7 +41,7 @@ module Reagan
|
|
41
41
|
result = system test
|
42
42
|
status = false if result == false
|
43
43
|
end
|
44
|
-
puts status ? 'PASS: reagan_test.yml test was successful' : ' FAIL: reagan_test.yml test was NOT successful'.indent
|
44
|
+
puts status ? 'PASS: reagan_test.yml test was successful' : ' FAIL: reagan_test.yml test was NOT successful'.indent.to_red
|
45
45
|
status
|
46
46
|
else
|
47
47
|
puts 'SKIP: No reagan_test.yml file found in the cookbook path. Skipping test'.indent
|
data/lib/reagan/test_version.rb
CHANGED
@@ -69,7 +69,7 @@ module Reagan
|
|
69
69
|
puts "Running cookbook version rev'd test:"
|
70
70
|
puts "Server version: #{serv_v}".indent
|
71
71
|
puts "Commit version: #{commit_v}".indent
|
72
|
-
puts updated ? "PASS: Metadata version has been rev'd".indent : "FAIL: Metadata version has NOT been rev'd".indent
|
72
|
+
puts updated ? "PASS: Metadata version has been rev'd".indent : "FAIL: Metadata version has NOT been rev'd".indent.to_red
|
73
73
|
updated
|
74
74
|
end
|
75
75
|
end
|
data/lib/reagan.rb
CHANGED
data/reagan.gemspec
CHANGED