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

111 lines
3.9 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)
= link_to namespace_project_build_url(job.project.namespace, job.project, job) do
%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
2017-08-17 22:00:37 +05:30
= job.tag? ? icon('tag') : icon('code-fork')
= link_to job.ref, namespace_project_commits_path(job.project.namespace, job.project, job.ref), class: "monospace branch-name"
2016-11-03 12:29:30 +05:30
- else
.light none
.icon-container.commit-icon
= custom_icon("icon_commit")
- if commit_sha
2017-08-17 22:00:37 +05:30
= link_to job.short_sha, namespace_project_commit_path(job.project.namespace, job.project, job.sha), class: "commit-id monospace"
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|
2016-11-03 12:29:30 +05:30
%span.label.label-primary
= tag
2017-08-17 22:00:37 +05:30
- if job.try(:trigger_request)
2016-11-03 12:29:30 +05:30
%span.label.label-info triggered
2017-08-17 22:00:37 +05:30
- if job.try(:allow_failure)
2016-11-03 12:29:30 +05:30
%span.label.label-danger allowed to fail
2017-08-17 22:00:37 +05:30
- if job.action?
2016-11-03 12:29:30 +05:30
%span.label.label-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
%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
= link_to job.project.name_with_namespace, admin_namespace_project_path(job.project.namespace, job.project)
%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
.pull-right
2017-08-17 22:00:37 +05:30
- if can?(current_user, :read_build, job) && job.artifacts?
= link_to download_namespace_project_build_artifacts_path(job.project.namespace, job.project, job), rel: 'nofollow', download: '', title: 'Download artifacts', class: 'btn btn-build' do
2016-06-02 11:05:42 +05:30
= icon('download')
2017-08-17 22:00:37 +05:30
- if can?(current_user, :update_build, job)
- if job.active?
= link_to cancel_namespace_project_build_path(job.project.namespace, 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')
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)
= link_to play_namespace_project_build_path(job.project.namespace, 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?
= link_to retry_namespace_project_build_path(job.project.namespace, job.project, job, return_to: request.original_url), method: :post, title: 'Retry', class: 'btn btn-build' do
= icon('repeat')