_pipeline.html.haml 4.18 KB
Newer Older
1
- status = pipeline.status
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
2 3
%tr.commit
  %td.commit-link
4 5 6
    = link_to namespace_project_pipeline_path(@project.namespace, @project, pipeline.id) do
      = ci_status_with_icon(status)

Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
7 8

  %td
9
    .branch-commit
Annabel Dunstone's avatar
Annabel Dunstone committed
10 11
      = link_to namespace_project_pipeline_path(@project.namespace, @project, pipeline.id) do
        %span ##{pipeline.id}
12
      - if pipeline.ref
13
        = link_to pipeline.ref, namespace_project_commits_path(@project.namespace, @project, pipeline.ref), class: "monospace branch-name"
14
        = custom_icon("icon_commit")
15 16
      = link_to pipeline.short_sha, namespace_project_commit_path(@project.namespace, @project, pipeline.sha), class: "commit-id monospace"
      - if pipeline.tag?
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
17
        %span.label.label-primary tag
18
      - elsif pipeline.latest?
19
        %span.label.label-success.has-tooltip{ title: 'Latest build for this branch' } latest
20
      - if pipeline.triggered?
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
21
        %span.label.label-primary triggered
22 23 24
      - if pipeline.yaml_errors.present?
        %span.label.label-danger.has-tooltip{ title: "#{pipeline.yaml_errors}" } yaml invalid
      - if pipeline.builds.any?(&:stuck?)
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
25 26
        %span.label.label-warning stuck

27
      %p.commit-title
28
        - if commit = pipeline.commit
29
          = commit_author_avatar(commit, size: 20)
30
          = link_to_gfm truncate(commit.title, length: 60), namespace_project_commit_path(@project.namespace, @project, commit.id), class: "commit-row-message"
31 32
        - else
          Cant find HEAD commit for this branch
Kamil Trzcinski's avatar
Kamil Trzcinski committed
33

Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
34

35
    - stages_status = pipeline.statuses.latest.stages_status
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
36 37
    - stages.each do |stage|
      %td
38 39 40
        - status = stages_status[stage]
        - tooltip = "#{stage.titleize}: #{status || 'not found'}"
        - if status
41
          = link_to namespace_project_pipeline_path(@project.namespace, @project, pipeline.id, anchor: stage), class: "has-tooltip ci-status-icon-#{status}", title: tooltip do
Kamil Trzcinski's avatar
Kamil Trzcinski committed
42
            = ci_icon_for_status(status)
43
        - else
Kamil Trzcinski's avatar
Kamil Trzcinski committed
44
          .light.has-tooltip{ title: tooltip }
45
            \-
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
46 47

  %td
48
    - if pipeline.started_at && pipeline.finished_at
49
      %p.duration
50
        = custom_icon("icon_timer")
51
        = duration_in_numbers(pipeline.finished_at, pipeline.started_at)
52
    - if pipeline.finished_at
53
      %p.finished-at
54 55
        = icon("calendar")
        #{time_ago_with_tooltip(pipeline.finished_at)}
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
56

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

      - if can?(current_user, :update_pipeline, @project)
87
        .cancel-retry-btns.inline
88 89 90 91 92 93
          - if pipeline.retryable?
            = link_to retry_namespace_project_pipeline_path(@project.namespace, @project, pipeline.id), class: 'btn has-tooltip', title: "Retry", method: :post do
              = icon("repeat")
          - if pipeline.cancelable?
            = link_to cancel_namespace_project_pipeline_path(@project.namespace, @project, pipeline.id), class: 'btn btn-remove has-tooltip', title: "Cancel", method: :post do
              = icon("remove")