Commit b692a439 authored by Valery Sizov's avatar Valery Sizov

Jenkins service: update parser

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