mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-15 07:36:41 +10:00
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:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user