2017-04-05 11:33:19 -04:00
- job = build.present(current_user: current_user)
- pipeline = job.pipeline
2016-09-12 07:58:38 -04: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 10:00:00 -05:00
- pipeline_link = local_assigns.fetch(:pipeline_link, false)
2016-09-12 07:58:38 -04:00
- stage = local_assigns.fetch(:stage, false)
- allow_retry = local_assigns.fetch(:allow_retry, false)
2016-09-07 09:27:48 -04:00
2016-12-26 05:47:16 -05:00
%tr.build.commit{ class: ('retried' if retried) }
2016-03-09 10:24:02 -05:00
%td.status
2017-04-05 11:33:19 -04:00
= render "ci/status/badge", status: job.detailed_status(current_user), title: job.status_title
2016-03-09 10:24:02 -05:00
2019-04-25 14:49:13 -04:00
%td.branch-commit.cgray
2017-04-05 11:33:19 -04:00
- if can?(current_user, :read_build, job)
2017-12-04 21:18:45 -05:00
= link_to project_job_path(job.project, job) do
2017-04-05 11:33:19 -04:00
%span.build-link ##{job.id}
2016-09-29 06:31:47 -04:00
- else
2017-04-05 11:33:19 -04:00
%span.build-link ##{job.id}
2016-03-09 10:24:02 -05:00
2016-09-29 06:31:47 -04:00
- if ref
2017-04-05 11:33:19 -04:00
- if job.ref
2020-09-29 05:09:49 -04:00
.icon-container.gl-display-inline-block
2020-10-14 08:08:58 -04:00
= job.tag? ? sprite_icon('label', css_class: 'sprite') : sprite_icon('fork', css_class: 'sprite')
2017-05-11 11:47:44 -04:00
= link_to job.ref, project_ref_path(job.project, job.ref), class: "ref-name"
2016-09-29 06:31:47 -04:00
- else
2019-01-25 04:34:48 -05:00
.light= _('none')
2016-10-10 09:46:28 -04:00
.icon-container.commit-icon
2016-09-29 06:31:47 -04:00
= custom_icon("icon_commit")
2016-07-11 09:38:27 -04:00
2016-09-29 06:31:47 -04:00
- if commit_sha
2019-04-08 11:22:01 -04:00
= link_to job.short_sha, project_commit_path(job.project, job.sha), class: "commit-sha mr-0"
2016-07-11 09:38:27 -04:00
2017-04-05 11:33:19 -04:00
- if job.stuck?
2020-10-14 08:08:58 -04:00
%span.has-tooltip{ title: _('Job is stuck. Check runners.') }
= sprite_icon('warning', css_class: 'text-warning!')
2016-09-08 10:40:10 -04:00
2016-10-14 10:20:55 -04:00
- if retried
2020-10-14 08:08:58 -04:00
%span.has-tooltip{ title: _('Job was retried') }
= sprite_icon('retry', css_class: 'text-warning')
2016-07-27 12:51:52 -04:00
2016-09-29 06:31:47 -04:00
.label-container
2017-04-05 11:33:19 -04:00
- if job.tags.any?
- job.tags.each do |tag|
2018-04-13 15:35:23 -04:00
%span.badge.badge-primary
2016-09-29 06:31:47 -04:00
= tag
2017-04-05 11:33:19 -04:00
- if job.try(:trigger_request)
2019-01-25 04:34:48 -05:00
%span.badge.badge-info= _('triggered')
2020-02-25 22:09:07 -05:00
- if job.try(:allow_failure) && !job.success?
2020-01-29 10:08:59 -05:00
%span.badge.badge-warning= _('allowed to fail')
2018-10-02 03:04:31 -04:00
- if job.schedulable?
2018-10-19 12:28:41 -04:00
%span.badge.badge-info= s_('DelayedJobs|delayed')
2018-10-02 03:04:31 -04:00
- elsif job.action?
2019-01-25 04:34:48 -05:00
%span.badge.badge-info= _('manual')
2016-03-09 10:24:02 -05:00
2016-11-10 10:00:00 -05:00
- if pipeline_link
2019-06-14 09:17:18 -04:00
%td
= link_to pipeline_path(pipeline) do
2017-04-04 14:49:16 -04:00
%span.pipeline-id ##{pipeline.id}
2016-11-10 10:00:00 -05:00
%span by
2017-04-04 14:49:16 -04:00
- if pipeline.user
= user_avatar(user: pipeline.user, size: 20)
2016-11-10 10:00:00 -05:00
- else
2018-11-20 13:47:38 -05:00
%span.monospace API
2016-10-24 16:47:02 -04:00
2016-09-07 09:27:48 -04:00
- if admin
%td
2017-04-05 11:33:19 -04:00
- if job.project
2018-03-05 08:45:35 -05:00
= link_to job.project.full_name, admin_project_path(job.project)
2016-03-09 10:24:02 -05:00
%td
2017-04-05 11:33:19 -04:00
- if job.try(:runner)
= runner_link(job.runner)
2016-03-09 10:24:02 -05:00
- else
2019-01-25 04:34:48 -05:00
.light= _('none')
2016-03-09 10:24:02 -05:00
2016-09-12 12:16:40 -04:00
- if stage
2016-09-08 04:26:16 -04:00
%td
2017-04-05 11:33:19 -04:00
= job.stage
2016-03-09 10:24:02 -05:00
%td
2017-04-05 11:33:19 -04:00
= job.name
2016-03-09 10:24:02 -05:00
2016-05-23 09:47:25 -04:00
%td
2017-04-05 11:33:19 -04:00
- if job.duration
2016-07-11 09:38:27 -04:00
%p.duration
2016-07-11 15:27:35 -04:00
= custom_icon("icon_timer")
2017-04-05 11:33:19 -04:00
= duration_in_numbers(job.duration)
2016-09-07 09:27:48 -04:00
2017-04-05 11:33:19 -04:00
- if job.finished_at
2016-07-11 09:38:27 -04:00
%p.finished-at
2020-10-14 08:08:58 -04:00
= sprite_icon("calendar")
2017-04-05 11:33:19 -04:00
%span= time_ago_with_tooltip(job.finished_at)
2016-03-09 10:24:02 -05:00
2016-09-07 09:27:48 -04:00
%td.coverage
2017-04-06 15:16:28 -04:00
- if job.try(:coverage)
2017-04-05 11:33:19 -04:00
#{job.coverage}%
2016-03-09 10:24:02 -05:00
%td
2018-04-09 13:42:45 -04:00
.float-right
2017-04-05 11:33:19 -04:00
- if can?(current_user, :read_build, job) && job.artifacts?
2020-07-27 14:09:54 -04:00
= link_to download_project_job_artifacts_path(job.project, job), rel: 'nofollow', download: '', title: _('Download artifacts'), class: 'btn btn-build gl-button btn-icon btn-svg' do
2017-11-16 14:34:15 -05:00
= sprite_icon('download')
2017-04-05 11:33:19 -04:00
- if can?(current_user, :update_build, job)
- if job.active?
2020-10-01 11:10:05 -04:00
= link_to cancel_project_job_path(job.project, job, continue: { to: request.fullpath }), method: :post, title: _('Cancel'), class: 'btn gl-button btn-build' do
2020-08-24 05:10:14 -04:00
= sprite_icon('close')
2018-09-20 03:31:08 -04:00
- elsif job.scheduled?
.btn-group
2020-10-01 11:10:05 -04:00
.btn.gl-button.btn-default{ disabled: true }
2018-09-20 03:31:08 -04:00
= sprite_icon('planning')
2018-10-29 06:23:11 -04:00
%time.js-remaining-time{ datetime: job.scheduled_at.utc.iso8601 }
= duration_in_numbers(job.execute_in)
2018-10-02 08:34:02 -04:00
- confirmation_message = s_("DelayedJobs|Are you sure you want to run %{job_name} immediately? This job will run automatically after it's timer finishes.") % { job_name: job.name }
2018-10-01 06:47:07 -04:00
= link_to play_project_job_path(job.project, job, return_to: request.original_url),
method: :post,
title: s_('DelayedJobs|Start now'),
2020-10-01 11:10:05 -04:00
class: 'btn gl-button btn-default btn-build has-tooltip',
2018-10-02 08:34:02 -04:00
data: { confirm: confirmation_message } do
2018-09-20 03:31:08 -04:00
= sprite_icon('play')
2018-10-01 06:47:07 -04:00
= link_to unschedule_project_job_path(job.project, job, return_to: request.original_url),
method: :post,
title: s_('DelayedJobs|Unschedule'),
2020-10-01 11:10:05 -04:00
class: 'btn gl-button btn-default btn-build has-tooltip' do
2018-09-28 05:50:00 -04:00
= sprite_icon('time-out')
2016-09-12 12:16:40 -04:00
- elsif allow_retry
2017-05-05 06:25:24 -04:00
- if job.playable? && !admin && can?(current_user, :update_build, job)
2020-10-01 11:10:05 -04:00
= link_to play_project_job_path(job.project, job, return_to: request.original_url), method: :post, title: _('Play'), class: 'btn gl-button btn-build' do
2016-08-25 17:15:44 -04:00
= custom_icon('icon_play')
2017-04-05 11:33:19 -04:00
- elsif job.retryable?
2020-07-23 11:09:28 -04:00
= link_to retry_project_job_path(job.project, job, return_to: request.original_url), method: :post, title: _('Retry'), class: 'btn btn-build gl-button btn-icon btn-default' do
= sprite_icon('repeat', css_class: 'gl-icon')