debian-mirror-gitlab/app/views/projects/ci/builds/_build.html.haml

131 lines
4.8 KiB
Text
Raw Normal View History

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
2016-11-03 12:29:30 +05:30
%td.branch-commit
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
.light none
.icon-container.commit-icon
= custom_icon("icon_commit")
- if commit_sha
2017-09-10 17:25:29 +05:30
= link_to job.short_sha, project_commit_path(job.project, job.sha), class: "commit-sha"
2016-08-24 12:49:21 +05:30
2017-08-17 22:00:37 +05:30
- if job.stuck?
= 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
2017-08-17 22:00:37 +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)
2018-11-08 19:23:39 +05:30
%span.badge.badge-info triggered
2017-08-17 22:00:37 +05:30
- if job.try(:allow_failure)
2018-11-08 19:23:39 +05:30
%span.badge.badge-danger allowed to fail
2018-12-05 23:21:45 +05:30
- if job.schedulable?
%span.badge.badge-info= s_('DelayedJobs|scheduled')
- elsif job.action?
2018-11-08 19:23:39 +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
2017-09-10 17:25:29 +05:30
%span.api 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
.light none
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?
2017-09-10 17:25:29 +05:30
= link_to download_project_job_artifacts_path(job.project, job), rel: 'nofollow', download: '', title: 'Download artifacts', class: 'btn btn-build' 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?
2017-09-10 17:25:29 +05:30
= link_to cancel_project_job_path(job.project, job, return_to: request.original_url), method: :post, title: 'Cancel', class: 'btn btn-build' do
2016-06-02 11:05:42 +05:30
= icon('remove', class: 'cred')
2018-12-05 23:21:45 +05:30
- elsif job.scheduled?
.btn-group
.btn.btn-default.has-tooltip{ disabled: true,
title: job.scheduled_at }
= sprite_icon('planning')
= duration_in_numbers(job.execute_in, true)
- 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)
2017-09-10 17:25:29 +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?
2017-09-10 17:25:29 +05:30
= link_to retry_project_job_path(job.project, job, return_to: request.original_url), method: :post, title: 'Retry', class: 'btn btn-build' do
2017-08-17 22:00:37 +05:30
= icon('repeat')