Commit 9089a5d1 authored by Marvin Frick's avatar Marvin Frick

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.
parent 2a79e0e2
...@@ -74,11 +74,12 @@ class JenkinsService < CiService ...@@ -74,11 +74,12 @@ class JenkinsService < CiService
end end
if response.code == 200 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' 'success'
elsif response.include?('alt="Failed"') || response.include?('alt="Aborted"') elsif status.include?('Failed') || status.include?('Aborted')
'failed' 'failed'
elsif response.include?('alt="In progress"') elsif status.include?('In progress')
'running' 'running'
else else
'pending' 'pending'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment