summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/builds_controller.rb1
-rw-r--r--app/helpers/builds_helper.rb10
-rw-r--r--app/models/build.rb6
-rw-r--r--app/models/commit.rb4
-rw-r--r--app/views/builds/show.html.haml27
5 files changed, 47 insertions, 1 deletions
diff --git a/app/controllers/builds_controller.rb b/app/controllers/builds_controller.rb
index 243aaae..28d6c06 100644
--- a/app/controllers/builds_controller.rb
+++ b/app/controllers/builds_controller.rb
@@ -22,6 +22,7 @@ class BuildsController < ApplicationController
@builds = @project.commits.find_by_sha(@build.sha).builds.order('id DESC')
@builds = @builds.where("id not in (?)", @build.id).page(params[:page]).per(20)
+ @commit = @build.commit
respond_to do |format|
format.html
diff --git a/app/helpers/builds_helper.rb b/app/helpers/builds_helper.rb
index 131d454..6266174 100644
--- a/app/helpers/builds_helper.rb
+++ b/app/helpers/builds_helper.rb
@@ -34,4 +34,14 @@ module BuildsHelper
'alert-warning'
end
end
+
+ def build_icon_css_class(build)
+ if build.success?
+ 'icon-circle cgreen'
+ elsif build.failed?
+ 'icon-circle cred'
+ else
+ 'icon-circle light'
+ end
+ end
end
diff --git a/app/models/build.rb b/app/models/build.rb
index ccf08e1..967d8c4 100644
--- a/app/models/build.rb
+++ b/app/models/build.rb
@@ -194,4 +194,10 @@ class Build < ActiveRecord::Base
# so we just silentrly ignore error for now
end
end
+
+ def job_name
+ if job
+ job.name
+ end
+ end
end
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 3532035..3d005b1 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -164,4 +164,8 @@ class Commit < ActiveRecord::Base
builds.first.coverage
end
end
+
+ def matrix?
+ builds_without_retry.size > 1
+ end
end
diff --git a/app/views/builds/show.html.haml b/app/views/builds/show.html.haml
index 4694bae..bd63829 100644
--- a/app/views/builds/show.html.haml
+++ b/app/views/builds/show.html.haml
@@ -1,5 +1,7 @@
%h4.page-title
= @project.name
+ @
+ = @commit.short_sha
.pull-right
= link_to edit_project_path(@project), class: "btn btn-default btn-small" do
%i.icon-edit.icon-white
@@ -10,6 +12,26 @@
&larr; Back to project commit
%hr
+- if @commit.matrix?
+ %ul.nav.nav-tabs.append-bottom-10
+ - @commit.builds_without_retry.each do |build|
+ %li{class: ('active' if build == @build) }
+ = link_to build_url(build) do
+ %i{class: build_icon_css_class(build)}
+ %span
+ Build ##{build.id}
+ - if build.job_name
+ &middot;
+ = build.job_name
+
+ - unless @commit.builds_without_retry.include?(@build)
+ %li.active
+ %a
+ Build ##{@build.id}
+ &middot;
+ %i.icon-warning-sign
+ This build was retried.
+
.row
.col-md-9
.build-head.alert{class: build_status_alert_class(@build)}
@@ -104,7 +126,10 @@
%tr.build.alert{class: build_status_alert_class(build)}
%td
= link_to build_url(build) do
- %span #{i+=1} &ndash; #{build.short_sha}
+ %span ##{build.id}
+ %td
+ - if build.job_name
+ = build.job_name
%td.status= build.status