changes the check for Jenkins_CI status

Instead of plaintext http response body reading, this service now checks for a value at a specified xpath in the document.
This commit is contained in:
Marvin Frick
2014-07-08 10:37:16 +02:00
parent 2a79e0e2bd
commit 9089a5d15b
@@ -74,11 +74,12 @@ class JenkinsService < CiService
end
if response.code == 200
if response.include?('alt="Success"')
status = Nokogiri.parse(response).xpath('//img[@class="build-caption-status-icon"]').first.attributes['alt'].value
if status.include?('Success')
'success'
elsif response.include?('alt="Failed"') || response.include?('alt="Aborted"')
elsif status.include?('Failed') || status.include?('Aborted')
'failed'
elsif response.include?('alt="In progress"')
elsif status.include?('In progress')
'running'
else
'pending'