_pipeline.html.haml 3.7 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
K
Kamil Trzcinski 已提交
9
    %div.branch-commit
10
      %span ##{pipeline.id}
11
      - if pipeline.ref
12
        = link_to pipeline.ref, namespace_project_commits_path(@project.namespace, @project, pipeline.ref), class: "monospace branch-name"
13
        = icon("code-fork")
14 15
      = link_to pipeline.short_sha, namespace_project_commit_path(@project.namespace, @project, pipeline.sha), class: "commit-id monospace"
      - if pipeline.tag?
K
WIP  
Kamil Trzcinski 已提交
16
        %span.label.label-primary tag
17
      - elsif pipeline.latest?
18
        %span.label.label-success.has-tooltip{ title: 'Latest build for this branch' } latest
19
      - if pipeline.triggered?
K
WIP  
Kamil Trzcinski 已提交
20
        %span.label.label-primary triggered
21 22 23
      - 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 已提交
24 25
        %span.label.label-warning stuck

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

K
WIP  
Kamil Trzcinski 已提交
33

34
    - stages_status = pipeline.statuses.stages_status
K
WIP  
Kamil Trzcinski 已提交
35 36
    - stages.each do |stage|
      %td
37 38 39
        - status = stages_status[stage]
        - tooltip = "#{stage.titleize}: #{status || 'not found'}"
        - if status
40
          = 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 已提交
41
            = ci_icon_for_status(status)
42
        - else
K
Kamil Trzcinski 已提交
43
          .light.has-tooltip{ title: tooltip }
44
            \-
K
WIP  
Kamil Trzcinski 已提交
45 46

  %td
47
    - if pipeline.started_at && pipeline.finished_at
48
      %p.duration
49
        = icon("clock-o")
50
        = duration_in_numbers(pipeline.finished_at, pipeline.started_at)
51
    - if pipeline.finished_at
52
      %p.finished-at
53 54
        = icon("calendar")
        #{time_ago_with_tooltip(pipeline.finished_at)}
K
WIP  
Kamil Trzcinski 已提交
55

56
  %td.pipeline-actions
K
WIP  
Kamil Trzcinski 已提交
57
    .controls.hidden-xs.pull-right
58
      - artifacts = pipeline.builds.latest.select { |b| b.artifacts? }
K
WIP  
Kamil Trzcinski 已提交
59
      - if artifacts.present?
60 61 62 63 64 65
        .btn-group.inline
          .btn-group
            %a.dropdown-toggle.btn.btn-default{type: 'button', 'data-toggle' => 'dropdown'}
              = icon("play")
              %b.caret
            %ul.dropdown-menu.dropdown-menu-align-right
K
WIP  
Kamil Trzcinski 已提交
66
              %li
67 68 69 70 71 72 73 74 75 76 77 78 79
                = link_to '#' do
                  = icon("play")
                  %span Deploy to production
          .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 已提交
80 81

      - if can?(current_user, :update_pipeline, @project)
82 83
        - if pipeline.retryable?
          = link_to retry_namespace_project_pipeline_path(@project.namespace, @project, pipeline.id), class: 'btn has-tooltip', title: "Retry", method: :post do
K
WIP  
Kamil Trzcinski 已提交
84
            = icon("repeat")
85 86
        - 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
K
Kamil Trzcinski 已提交
87
            = icon("remove")