2017-08-17 22:00:37 +05:30
- job = build.present(current_user: current_user)
- pipeline = job.pipeline
2016-09-29 09:46:39 +05:30
- 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)
2017-08-17 22:00:37 +05:30
- pipeline_link = local_assigns.fetch(:pipeline_link, false)
2016-09-29 09:46:39 +05:30
- stage = local_assigns.fetch(:stage, false)
- allow_retry = local_assigns.fetch(:allow_retry, false)
2017-08-17 22:00:37 +05:30
%tr.build.commit{ class: ('retried' if retried) }
2016-06-02 11:05:42 +05:30
%td.status
2017-08-17 22:00:37 +05:30
= render "ci/status/badge", status: job.detailed_status(current_user), title: job.status_title
2016-06-02 11:05:42 +05:30
2019-07-31 22:56:46 +05:30
%td.branch-commit.cgray
2017-08-17 22:00:37 +05:30
- if can?(current_user, :read_build, job)
2018-03-17 18:26:18 +05:30
= link_to project_job_path(job.project, job) do
2017-08-17 22:00:37 +05:30
%span.build-link ##{job.id}
2016-11-03 12:29:30 +05:30
- else
2017-08-17 22:00:37 +05:30
%span.build-link ##{job.id}
2016-06-02 11:05:42 +05:30
2016-11-03 12:29:30 +05:30
- if ref
2017-08-17 22:00:37 +05:30
- if job.ref
2016-08-24 12:49:21 +05:30
.icon-container
2018-03-17 18:26:18 +05:30
= job.tag? ? icon('tag') : sprite_icon('fork', css_class: 'sprite')
2017-09-10 17:25:29 +05:30
= link_to job.ref, project_ref_path(job.project, job.ref), class: "ref-name"
2016-11-03 12:29:30 +05:30
- else
2019-03-02 22:35:43 +05:30
.light= _('none')
2016-11-03 12:29:30 +05:30
.icon-container.commit-icon
= custom_icon("icon_commit")
- if commit_sha
2019-07-31 22:56:46 +05:30
= link_to job.short_sha, project_commit_path(job.project, job.sha), class: "commit-sha mr-0"
2016-08-24 12:49:21 +05:30
2017-08-17 22:00:37 +05:30
- if job.stuck?
2019-03-02 22:35:43 +05:30
= icon('warning', class: 'text-warning has-tooltip', title: _('Job is stuck. Check runners.'))
2016-08-24 12:49:21 +05:30
2016-11-03 12:29:30 +05:30
- if retried
2019-03-02 22:35:43 +05:30
= icon('refresh', class: 'text-warning has-tooltip', title: _('Job was retried'))
2016-09-13 17:45:13 +05:30
2016-11-03 12:29:30 +05:30
.label-container
2017-08-17 22:00:37 +05:30
- if job.tags.any?
- job.tags.each do |tag|
2018-11-08 19:23:39 +05:30
%span.badge.badge-primary
2016-11-03 12:29:30 +05:30
= tag
2017-08-17 22:00:37 +05:30
- if job.try(:trigger_request)
2019-03-02 22:35:43 +05:30
%span.badge.badge-info= _('triggered')
2020-04-08 14:13:33 +05:30
- if job.try(:allow_failure) && !job.success?
2020-03-13 15:44:24 +05:30
%span.badge.badge-warning= _('allowed to fail')
2018-12-05 23:21:45 +05:30
- if job.schedulable?
2018-12-13 13:39:08 +05:30
%span.badge.badge-info= s_('DelayedJobs|delayed')
2018-12-05 23:21:45 +05:30
- elsif job.action?
2019-03-02 22:35:43 +05:30
%span.badge.badge-info= _('manual')
2016-06-02 11:05:42 +05:30
2017-08-17 22:00:37 +05:30
- if pipeline_link
2016-09-29 09:46:39 +05:30
%td
2017-08-17 22:00:37 +05:30
= link_to pipeline_path(pipeline) do
%span.pipeline-id ##{pipeline.id}
%span by
- if pipeline.user
= user_avatar(user: pipeline.user, size: 20)
- else
2019-02-15 15:39:39 +05:30
%span.monospace API
2016-09-29 09:46:39 +05:30
- if admin
2016-06-02 11:05:42 +05:30
%td
2017-08-17 22:00:37 +05:30
- if job.project
2018-03-27 19:54:05 +05:30
= link_to job.project.full_name, admin_project_path(job.project)
2017-08-17 22:00:37 +05:30
%td
- if job.try(:runner)
= runner_link(job.runner)
2016-06-02 11:05:42 +05:30
- else
2019-03-02 22:35:43 +05:30
.light= _('none')
2016-06-02 11:05:42 +05:30
2016-09-29 09:46:39 +05:30
- if stage
2016-06-02 11:05:42 +05:30
%td
2017-08-17 22:00:37 +05:30
= job.stage
2016-06-02 11:05:42 +05:30
%td
2017-08-17 22:00:37 +05:30
= job.name
2016-06-02 11:05:42 +05:30
%td
2017-08-17 22:00:37 +05:30
- if job.duration
2016-08-24 12:49:21 +05:30
%p.duration
= custom_icon("icon_timer")
2017-08-17 22:00:37 +05:30
= duration_in_numbers(job.duration)
2016-09-29 09:46:39 +05:30
2017-08-17 22:00:37 +05:30
- if job.finished_at
2016-08-24 12:49:21 +05:30
%p.finished-at
= icon("calendar")
2017-08-17 22:00:37 +05:30
%span= time_ago_with_tooltip(job.finished_at)
2016-06-02 11:05:42 +05:30
2016-09-29 09:46:39 +05:30
%td.coverage
2017-08-17 22:00:37 +05:30
- if job.try(:coverage)
#{job.coverage}%
2016-06-02 11:05:42 +05:30
%td
2018-11-08 19:23:39 +05:30
.float-right
2017-08-17 22:00:37 +05:30
- if can?(current_user, :read_build, job) && job.artifacts?
2020-10-24 23:57:45 +05:30
= 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
2018-03-17 18:26:18 +05:30
= sprite_icon('download')
2017-08-17 22:00:37 +05:30
- if can?(current_user, :update_build, job)
- if job.active?
2019-03-02 22:35:43 +05:30
= link_to cancel_project_job_path(job.project, job, continue: { to: request.fullpath }), method: :post, title: _('Cancel'), class: 'btn btn-build' do
2020-11-24 15:15:51 +05:30
= sprite_icon('close')
2018-12-05 23:21:45 +05:30
- elsif job.scheduled?
.btn-group
2018-12-13 13:39:08 +05:30
.btn.btn-default{ disabled: true }
2018-12-05 23:21:45 +05:30
= sprite_icon('planning')
2018-12-13 13:39:08 +05:30
%time.js-remaining-time{ datetime: job.scheduled_at.utc.iso8601 }
= duration_in_numbers(job.execute_in)
2018-12-05 23:21:45 +05:30
- 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 }
= 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',
data: { confirm: confirmation_message } do
= sprite_icon('play')
= 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
= sprite_icon('time-out')
2016-09-29 09:46:39 +05:30
- elsif allow_retry
2017-08-17 22:00:37 +05:30
- if job.playable? && !admin && can?(current_user, :update_build, job)
2019-03-02 22:35:43 +05:30
= link_to play_project_job_path(job.project, job, return_to: request.original_url), method: :post, title: _('Play'), class: 'btn btn-build' do
2016-09-29 09:46:39 +05:30
= custom_icon('icon_play')
2017-08-17 22:00:37 +05:30
- elsif job.retryable?
2020-10-24 23:57:45 +05:30
= 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')