_pipeline.html.haml 4.2 KB
Newer Older
1
- status = pipeline.status
K
WIP  
Kamil Trzcinski 已提交
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)

K
WIP  
Kamil Trzcinski 已提交
7 8

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

28
      %p.commit-title
29
        - if commit = pipeline.commit
30
          = author_avatar(commit, size: 20)
31
          = link_to_gfm truncate(commit.title, length: 60), namespace_project_commit_path(@project.namespace, @project, commit.id), class: "commit-row-message"
32 33
        - else
          Cant find HEAD commit for this branch
K
Kamil Trzcinski 已提交
34

K
WIP  
Kamil Trzcinski 已提交
35

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

  %td
49
    - if pipeline.wall_clock_duration
50
      %p.duration
51
        = custom_icon("icon_timer")
52
        = duration_in_numbers_from_interval(pipeline.wall_clock_duration)
53
    - if pipeline.finished_at
54
      %p.finished-at
55
        = icon("calendar")
56
        #{time_ago_with_tooltip(pipeline.finished_at, short_format: true, skip_js: true)}
K
WIP  
Kamil Trzcinski 已提交
57

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

      - if can?(current_user, :update_pipeline, @project)
88
        .cancel-retry-btns.inline
89 90 91 92 93 94
          - 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")