Commit a8417724 authored by Jan Včelák's avatar Jan Včelák 🚀
Browse files

Merge pull request #4 from abrindeyev/master

Bugfixes
parents 46024a2b a86b1cf4
......@@ -59,7 +59,7 @@ class JenkinsConnector
def extract_build_info(data)
result = {
:build => data["number"],
:status => build_status_from_api(data["result"]),
:status => build_status_from_api(data),
:created_at => nil,
:commit => nil,
:branch => nil
......@@ -104,7 +104,9 @@ class JenkinsConnector
result
end
def build_status_from_api(api_string)
def build_status_from_api(build)
return "running" if build["building"]
api_string = build["result"]
if api_string.nil?
nil
else
......@@ -112,7 +114,8 @@ class JenkinsConnector
when "success" then "success"
when "aborted" then "canceled"
when "running" then "running"
else "failed"
when "failure" then "failed"
else nil
end
end
end
......
......@@ -84,7 +84,7 @@ get '/projects/:job_id/builds/:commit/status.json' do
if commit.status.nil?
status = "running"
elsif ["success", "failed"].include? commit.status
elsif ["success", "failed", "running"].include? commit.status
status = commit.status
else
status = "failed"
......
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