_pipeline.html.haml 4.23 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 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"
19
      - if pipeline.latest?
20
        %span.label.label-success.has-tooltip{ title: 'Latest build for this branch' } latest
21
      - if pipeline.triggered?
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
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?)
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
26 27
        %span.label.label-warning stuck

28
      %p.commit-title
29
        - if commit = pipeline.commit
30
          = commit_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
Kamil Trzcinski's avatar
Kamil Trzcinski committed
34

Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
35

36
    - stages_status = pipeline.statuses.latest.stages_status
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
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
Kamil Trzcinski's avatar
Kamil Trzcinski committed
43
            = ci_icon_for_status(status)
44
        - else
Kamil Trzcinski's avatar
Kamil Trzcinski committed
45
          .light.has-tooltip{ title: tooltip }
46
            \-
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
47 48

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

58
  %td.pipeline-actions
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
59
    .controls.hidden-xs.pull-right
60
      - artifacts = pipeline.builds.latest.select { |b| b.artifacts? }
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")
Kamil Trzcinski's avatar
Kamil Trzcinski committed
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
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
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")