gitlab-org--gitlab-foss/app/views/projects/ci/builds/_build.html.haml

133 lines
5.1 KiB
Text
Raw Normal View History

- 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)
- 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)
%tr.build.commit{ class: ('retried' if retried) }
%td.status
= render "ci/status/badge", status: job.detailed_status(current_user), title: job.status_title
%td.branch-commit.cgray
- if can?(current_user, :read_build, job)
= link_to project_job_path(job.project, job) do
%span.build-link ##{job.id}
- else
%span.build-link ##{job.id}
- if ref
- if job.ref
.icon-container.gl-display-inline-block
= job.tag? ? sprite_icon('label', css_class: 'sprite') : sprite_icon('fork', css_class: 'sprite')
= link_to job.ref, project_ref_path(job.project, job.ref), class: "ref-name"
- else
.light= _('none')
2016-10-10 09:46:28 -04:00
.icon-container.commit-icon
= custom_icon("icon_commit")
2016-07-11 09:38:27 -04:00
- if commit_sha
= 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
- if job.stuck?
%span.has-tooltip{ title: _('Job is stuck. Check runners.') }
= sprite_icon('warning', css_class: 'text-warning!')
- if retried
%span.has-tooltip{ title: _('Job was retried') }
= sprite_icon('retry', css_class: 'text-warning')
.label-container
- if job.tags.any?
- job.tags.each do |tag|
%span.badge.badge-primary
= tag
- if job.try(:trigger_request)
%span.badge.badge-info= _('triggered')
- if job.try(:allow_failure) && !job.success?
%span.badge.badge-warning= _('allowed to fail')
- if job.schedulable?
%span.badge.badge-info= s_('DelayedJobs|delayed')
- elsif job.action?
%span.badge.badge-info= _('manual')
- if pipeline_link
%td
= link_to pipeline_path(pipeline) do
2017-04-04 14:49:16 -04:00
%span.pipeline-id ##{pipeline.id}
%span by
2017-04-04 14:49:16 -04:00
- if pipeline.user
= user_avatar(user: pipeline.user, size: 20)
- else
%span.monospace API
- if admin
%td
- if job.project
= link_to job.project.full_name, admin_project_path(job.project)
%td
- if job.try(:runner)
= runner_link(job.runner)
- else
.light= _('none')
2016-09-12 12:16:40 -04:00
- if stage
2016-09-08 04:26:16 -04:00
%td
= job.stage
%td
= job.name
2016-05-23 09:47:25 -04:00
%td
- if job.duration
2016-07-11 09:38:27 -04:00
%p.duration
= custom_icon("icon_timer")
= duration_in_numbers(job.duration)
- if job.finished_at
2016-07-11 09:38:27 -04:00
%p.finished-at
= sprite_icon("calendar")
%span= time_ago_with_tooltip(job.finished_at)
%td.coverage
- if job.try(:coverage)
#{job.coverage}%
%td
.float-right
- if can?(current_user, :read_build, job) && job.artifacts?
= 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
= sprite_icon('download')
- if can?(current_user, :update_build, job)
- if job.active?
= link_to cancel_project_job_path(job.project, job, continue: { to: request.fullpath }), method: :post, title: _('Cancel'), class: 'btn gl-button btn-build' do
= sprite_icon('close')
2018-09-20 03:31:08 -04:00
- elsif job.scheduled?
.btn-group
.btn.gl-button.btn-default{ disabled: true }
2018-09-20 03:31:08 -04:00
= sprite_icon('planning')
%time.js-remaining-time{ datetime: job.scheduled_at.utc.iso8601 }
= duration_in_numbers(job.execute_in)
- 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 gl-button btn-default btn-build has-tooltip',
data: { confirm: confirmation_message } do
2018-09-20 03:31:08 -04:00
= 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 gl-button btn-default btn-build has-tooltip' do
= sprite_icon('time-out')
2016-09-12 12:16:40 -04:00
- elsif allow_retry
- if job.playable? && !admin && can?(current_user, :update_build, job)
= 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')
- elsif job.retryable?
= 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')