Commit b692a439 authored by Valery Sizov's avatar Valery Sizov

Jenkins service: update parser

parent 4359949d
......@@ -69,12 +69,13 @@ class JenkinsService < CiService
end
if response.code == 200
status = Nokogiri.parse(response).xpath('//img[@class="build-caption-status-icon"]').first.attributes['alt'].value
if status.include?('Success')
# img.build-caption-status-icon for old jenkins version
src = Nokogiri.parse(response).css('img.build-caption-status-icon,.build-caption>img').first.attributes['src'].value
if src =~ /blue\.png$/
'success'
elsif status.include?('Failed') || status.include?('Aborted')
elsif src =~ /(red\.png|aborted\.png)$/
'failed'
elsif status.include?('In progress')
elsif src =~ /anime\.gif$/
'running'
else
'pending'
......
......@@ -21,10 +21,6 @@
.bs-callout
= @service.help
- if @service.help.present?
.bs-callout
= @service.help
.form-group
= f.label :active, "Active", class: "control-label"
.col-sm-10
......
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