_pipeline.html.haml 4.67 KB
Newer Older
1
- status = pipeline.status
2 3 4
- show_commit = local_assigns.fetch(:show_commit, true)
- show_branch = local_assigns.fetch(:show_branch, true)

Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
5 6
%tr.commit
  %td.commit-link
Dimitrie Hoekstra's avatar
Dimitrie Hoekstra committed
7 8 9
    = link_to namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), class: "ci-status ci-#{status}" do
      = ci_icon_for_status(status)
      = ci_label_for_status(status)
10 11

  %td
12
    = link_to namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id) do
13 14
      %span.pipeline-id ##{pipeline.id}
    %span by
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
15 16
    - if pipeline.user
      = user_avatar(user: pipeline.user, size: 20)
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
17 18
    - else
      %span.api.monospace API
19 20 21 22 23 24 25 26
    - if pipeline.latest?
      %span.label.label-success.has-tooltip{ title: 'Latest build for this branch' } latest
    - if pipeline.triggered?
      %span.label.label-primary triggered
    - if pipeline.yaml_errors.present?
      %span.label.label-danger.has-tooltip{ title: "#{pipeline.yaml_errors}" } yaml invalid
    - if pipeline.builds.any?(&:stuck?)
      %span.label.label-warning stuck
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
27

28 29 30 31 32 33
  %td.branch-commit
    - if pipeline.ref && show_branch
      .icon-container
        = pipeline.tag? ? icon('tag') : icon('code-fork')
      = link_to pipeline.ref, namespace_project_commits_path(pipeline.project.namespace, pipeline.project, pipeline.ref), class: "monospace branch-name"
    - if show_commit
Annabel Dunstone Gray's avatar
Annabel Dunstone Gray committed
34
      .icon-container.commit-icon
35 36 37
        = custom_icon("icon_commit")
      = link_to pipeline.short_sha, namespace_project_commit_path(pipeline.project.namespace, pipeline.project, pipeline.sha), class: "commit-id monospace"

38 39 40
    %p.commit-title
      - if commit = pipeline.commit
        = author_avatar(commit, size: 20)
41
        = link_to_gfm truncate(commit.title, length: 60, escape: false), namespace_project_commit_path(pipeline.project.namespace, pipeline.project, commit.id), class: "commit-row-message"
42 43
      - else
        Cant find HEAD commit for this branch
Kamil Trzcinski's avatar
Kamil Trzcinski committed
44

45
  - stages_status = pipeline.statuses.latest.stages_status
46 47 48 49 50 51 52 53
  %td.stage-cell
    - stages.each do |stage|
      - status = stages_status[stage]
      - tooltip = "#{stage.titleize}: #{status || 'not found'}"
      - if status
        .stage-container
          = link_to namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id, anchor: stage), class: "has-tooltip ci-status-icon-#{status}", title: tooltip do
            = ci_icon_for_status(status)
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
54 55

  %td
56
    - if pipeline.duration
57
      %p.duration
58
        = custom_icon("icon_timer")
59
        = duration_in_numbers(pipeline.duration)
60
    - if pipeline.finished_at
61
      %p.finished-at
62
        = icon("calendar")
63
        #{time_ago_with_tooltip(pipeline.finished_at, short_format: false)}
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
64

65 66
  %td.pipeline-actions.hidden-xs
    .controls.pull-right
67
      - artifacts = pipeline.builds.latest.with_artifacts_not_expired
68 69
      - actions = pipeline.manual_actions
      - if artifacts.present? || actions.any?
70
        .btn-group.inline
71
          - if actions.any?
72 73
            .btn-group
              %a.dropdown-toggle.btn.btn-default{type: 'button', 'data-toggle' => 'dropdown'}
74
                = custom_icon('icon_play')
75
                = icon('caret-down')
76
              %ul.dropdown-menu.dropdown-menu-align-right
77 78
                - actions.each do |build|
                  %li
79
                    = link_to play_namespace_project_build_path(pipeline.project.namespace, pipeline.project, build), method: :post, rel: 'nofollow' do
80
                      = custom_icon('icon_play')
Kamil Trzcinski's avatar
Kamil Trzcinski committed
81
                      %span= build.name.humanize
82 83 84 85
          - if artifacts.present?
            .btn-group
              %a.dropdown-toggle.btn.btn-default.build-artifacts{type: 'button', 'data-toggle' => 'dropdown'}
                = icon("download")
86
                = icon('caret-down')
87 88 89
              %ul.dropdown-menu.dropdown-menu-align-right
                - artifacts.each do |build|
                  %li
90
                    = link_to download_namespace_project_build_artifacts_path(pipeline.project.namespace, pipeline.project, build), rel: 'nofollow' do
91 92
                      = icon("download")
                      %span Download '#{build.name}' artifacts
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
93

94
      - if can?(current_user, :update_pipeline, pipeline.project)
95
        .cancel-retry-btns.inline
96
          - if pipeline.retryable?
97
            = link_to retry_namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), class: 'btn has-tooltip', title: "Retry", method: :post do
98 99
              = icon("repeat")
          - if pipeline.cancelable?
100
            = link_to cancel_namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), class: 'btn btn-remove has-tooltip', title: "Cancel", method: :post do
101
              = icon("remove")