2017-04-05 15:33:19 +00:00
|
|
|
- job = build.present(current_user: current_user)
|
|
|
|
- pipeline = job.pipeline
|
2016-09-12 11:58:38 +00:00
|
|
|
- admin = local_assigns.fetch(:admin, false)
|
|
|
|
- ref = local_assigns.fetch(:ref, nil)
|
|
|
|
- commit_sha = local_assigns.fetch(:commit_sha, nil)
|
|
|
|
- retried = local_assigns.fetch(:retried, false)
|
2016-11-10 15:00:00 +00:00
|
|
|
- pipeline_link = local_assigns.fetch(:pipeline_link, false)
|
2016-09-12 11:58:38 +00:00
|
|
|
- stage = local_assigns.fetch(:stage, false)
|
|
|
|
- allow_retry = local_assigns.fetch(:allow_retry, false)
|
2016-09-07 13:27:48 +00:00
|
|
|
|
2016-12-26 10:47:16 +00:00
|
|
|
%tr.build.commit{ class: ('retried' if retried) }
|
2016-03-09 15:24:02 +00:00
|
|
|
%td.status
|
2017-04-05 15:33:19 +00:00
|
|
|
= render "ci/status/badge", status: job.detailed_status(current_user), title: job.status_title
|
2016-03-09 15:24:02 +00:00
|
|
|
|
2016-09-29 10:31:47 +00:00
|
|
|
%td.branch-commit
|
2017-04-05 15:33:19 +00:00
|
|
|
- if can?(current_user, :read_build, job)
|
2017-12-05 02:18:45 +00:00
|
|
|
= link_to project_job_path(job.project, job) do
|
2017-04-05 15:33:19 +00:00
|
|
|
%span.build-link ##{job.id}
|
2016-09-29 10:31:47 +00:00
|
|
|
- else
|
2017-04-05 15:33:19 +00:00
|
|
|
%span.build-link ##{job.id}
|
2016-03-09 15:24:02 +00:00
|
|
|
|
2016-09-29 10:31:47 +00:00
|
|
|
- if ref
|
2017-04-05 15:33:19 +00:00
|
|
|
- if job.ref
|
2016-07-20 16:17:52 +00:00
|
|
|
.icon-container
|
2017-12-01 18:57:34 +00:00
|
|
|
= job.tag? ? icon('tag') : sprite_icon('fork', css_class: 'sprite')
|
2017-05-11 15:47:44 +00:00
|
|
|
= link_to job.ref, project_ref_path(job.project, job.ref), class: "ref-name"
|
2016-09-29 10:31:47 +00:00
|
|
|
- else
|
|
|
|
.light none
|
2016-10-10 13:46:28 +00:00
|
|
|
.icon-container.commit-icon
|
2016-09-29 10:31:47 +00:00
|
|
|
= custom_icon("icon_commit")
|
2016-07-11 13:38:27 +00:00
|
|
|
|
2016-09-29 10:31:47 +00:00
|
|
|
- if commit_sha
|
2017-06-29 17:06:35 +00:00
|
|
|
= link_to job.short_sha, project_commit_path(job.project, job.sha), class: "commit-sha"
|
2016-07-11 13:38:27 +00:00
|
|
|
|
2017-04-05 15:33:19 +00:00
|
|
|
- if job.stuck?
|
2017-01-26 11:52:58 +00:00
|
|
|
= icon('warning', class: 'text-warning has-tooltip', title: 'Job is stuck. Check runners.')
|
2016-09-08 14:40:10 +00:00
|
|
|
|
2016-10-14 14:20:55 +00:00
|
|
|
- if retried
|
2017-05-23 21:09:41 +00:00
|
|
|
= icon('refresh', class: 'text-warning has-tooltip', title: 'Job was retried')
|
2016-07-27 16:51:52 +00:00
|
|
|
|
2016-09-29 10:31:47 +00:00
|
|
|
.label-container
|
2017-04-05 15:33:19 +00:00
|
|
|
- if job.tags.any?
|
|
|
|
- job.tags.each do |tag|
|
2018-04-13 19:35:23 +00:00
|
|
|
%span.badge.badge-primary
|
2016-09-29 10:31:47 +00:00
|
|
|
= tag
|
2017-04-05 15:33:19 +00:00
|
|
|
- if job.try(:trigger_request)
|
2018-04-13 19:37:55 +00:00
|
|
|
%span.badge.badge-info triggered
|
2017-04-05 15:33:19 +00:00
|
|
|
- if job.try(:allow_failure)
|
2018-04-13 19:37:07 +00:00
|
|
|
%span.badge.badge-danger allowed to fail
|
2017-04-05 15:33:19 +00:00
|
|
|
- if job.action?
|
2018-04-13 19:37:55 +00:00
|
|
|
%span.badge.badge-info manual
|
2018-10-01 16:12:30 +00:00
|
|
|
- if job.scheduled?
|
|
|
|
%span.badge.badge-info= s_('DelayedJobs|scheduled')
|
2016-03-09 15:24:02 +00:00
|
|
|
|
2016-11-10 15:00:00 +00:00
|
|
|
- if pipeline_link
|
|
|
|
%td
|
2017-04-04 18:49:16 +00:00
|
|
|
= link_to pipeline_path(pipeline) do
|
|
|
|
%span.pipeline-id ##{pipeline.id}
|
2016-11-10 15:00:00 +00:00
|
|
|
%span by
|
2017-04-04 18:49:16 +00:00
|
|
|
- if pipeline.user
|
|
|
|
= user_avatar(user: pipeline.user, size: 20)
|
2016-11-10 15:00:00 +00:00
|
|
|
- else
|
2017-05-11 15:47:44 +00:00
|
|
|
%span.api API
|
2016-10-24 20:47:02 +00:00
|
|
|
|
2016-09-07 13:27:48 +00:00
|
|
|
- if admin
|
|
|
|
%td
|
2017-04-05 15:33:19 +00:00
|
|
|
- if job.project
|
2018-03-05 13:45:35 +00:00
|
|
|
= link_to job.project.full_name, admin_project_path(job.project)
|
2016-03-09 15:24:02 +00:00
|
|
|
%td
|
2017-04-05 15:33:19 +00:00
|
|
|
- if job.try(:runner)
|
|
|
|
= runner_link(job.runner)
|
2016-03-09 15:24:02 +00:00
|
|
|
- else
|
|
|
|
.light none
|
|
|
|
|
2016-09-12 16:16:40 +00:00
|
|
|
- if stage
|
2016-09-08 08:26:16 +00:00
|
|
|
%td
|
2017-04-05 15:33:19 +00:00
|
|
|
= job.stage
|
2016-03-09 15:24:02 +00:00
|
|
|
|
|
|
|
%td
|
2017-04-05 15:33:19 +00:00
|
|
|
= job.name
|
2016-03-09 15:24:02 +00:00
|
|
|
|
2016-05-23 13:47:25 +00:00
|
|
|
%td
|
2017-04-05 15:33:19 +00:00
|
|
|
- if job.duration
|
2016-07-11 13:38:27 +00:00
|
|
|
%p.duration
|
2016-07-11 19:27:35 +00:00
|
|
|
= custom_icon("icon_timer")
|
2017-04-05 15:33:19 +00:00
|
|
|
= duration_in_numbers(job.duration)
|
2016-09-07 13:27:48 +00:00
|
|
|
|
2017-04-05 15:33:19 +00:00
|
|
|
- if job.finished_at
|
2016-07-11 13:38:27 +00:00
|
|
|
%p.finished-at
|
|
|
|
= icon("calendar")
|
2017-04-05 15:33:19 +00:00
|
|
|
%span= time_ago_with_tooltip(job.finished_at)
|
2016-03-09 15:24:02 +00:00
|
|
|
|
2016-09-07 13:27:48 +00:00
|
|
|
%td.coverage
|
2017-04-06 19:16:28 +00:00
|
|
|
- if job.try(:coverage)
|
2017-04-05 15:33:19 +00:00
|
|
|
#{job.coverage}%
|
2016-03-09 15:24:02 +00:00
|
|
|
|
|
|
|
%td
|
2018-04-09 17:42:45 +00:00
|
|
|
.float-right
|
2017-04-05 15:33:19 +00:00
|
|
|
- if can?(current_user, :read_build, job) && job.artifacts?
|
2017-06-29 17:06:35 +00:00
|
|
|
= link_to download_project_job_artifacts_path(job.project, job), rel: 'nofollow', download: '', title: 'Download artifacts', class: 'btn btn-build' do
|
2017-11-16 19:34:15 +00:00
|
|
|
= sprite_icon('download')
|
2017-04-05 15:33:19 +00:00
|
|
|
- if can?(current_user, :update_build, job)
|
|
|
|
- if job.active?
|
2017-06-29 17:06:35 +00:00
|
|
|
= link_to cancel_project_job_path(job.project, job, return_to: request.original_url), method: :post, title: 'Cancel', class: 'btn btn-build' do
|
2016-05-09 23:26:13 +00:00
|
|
|
= icon('remove', class: 'cred')
|
2018-09-20 07:31:08 +00:00
|
|
|
- elsif job.scheduled?
|
|
|
|
.btn-group
|
|
|
|
.btn.btn-default.has-tooltip{ disabled: true,
|
2018-09-24 11:02:26 +00:00
|
|
|
title: job.scheduled_at }
|
2018-09-20 07:31:08 +00:00
|
|
|
= sprite_icon('planning')
|
2018-09-27 11:44:03 +00:00
|
|
|
= duration_in_numbers(job.execute_in, true)
|
2018-10-01 10:47:07 +00:00
|
|
|
= link_to play_project_job_path(job.project, job, return_to: request.original_url),
|
|
|
|
method: :post,
|
|
|
|
title: s_('DelayedJobs|Start now'),
|
|
|
|
class: 'btn btn-default btn-build has-tooltip' do
|
2018-09-20 07:31:08 +00:00
|
|
|
= sprite_icon('play')
|
2018-10-01 10:47:07 +00:00
|
|
|
= link_to unschedule_project_job_path(job.project, job, return_to: request.original_url),
|
|
|
|
method: :post,
|
|
|
|
title: s_('DelayedJobs|Unschedule'),
|
|
|
|
class: 'btn btn-default btn-build has-tooltip' do
|
2018-09-28 09:50:00 +00:00
|
|
|
= sprite_icon('time-out')
|
2016-09-12 16:16:40 +00:00
|
|
|
- elsif allow_retry
|
2017-05-05 10:25:24 +00:00
|
|
|
- if job.playable? && !admin && can?(current_user, :update_build, job)
|
2017-06-29 17:06:35 +00:00
|
|
|
= link_to play_project_job_path(job.project, job, return_to: request.original_url), method: :post, title: 'Play', class: 'btn btn-build' do
|
2016-08-25 21:15:44 +00:00
|
|
|
= custom_icon('icon_play')
|
2017-04-05 15:33:19 +00:00
|
|
|
- elsif job.retryable?
|
2017-06-29 17:06:35 +00:00
|
|
|
= link_to retry_project_job_path(job.project, job, return_to: request.original_url), method: :post, title: 'Retry', class: 'btn btn-build' do
|
2016-12-07 21:17:58 +00:00
|
|
|
= icon('repeat')
|