summaryrefslogtreecommitdiff
path: root/app/views/projects/ci/pipelines/_pipeline.html.haml
blob: a0ffa065067962943c571410bfe4163b87db6888 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
- status = pipeline.status
%tr.commit
  %td.commit-link
    = link_to namespace_project_pipeline_path(@project.namespace, @project, pipeline.id), class: "ci-status ci-#{status}" do
      = ci_icon_for_status(status)
      %strong ##{pipeline.id}

  %td
    %div.branch-commit
      - if pipeline.ref
        = link_to pipeline.ref, namespace_project_commits_path(@project.namespace, @project, pipeline.ref), class: "monospace"
        ·
      = link_to pipeline.short_sha, namespace_project_commit_path(@project.namespace, @project, pipeline.sha), class: "commit-id monospace"
       
      - if pipeline.tag?
        %span.label.label-primary tag
      - elsif 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

      %p.commit-title
        - if commit_data = pipeline.commit_data
          = link_to_gfm truncate(commit_data.title, length: 60), namespace_project_commit_path(@project.namespace, @project, commit_data.id), class: "commit-row-message"
        - else
          Cant find HEAD commit for this branch


    - stages_status = pipeline.statuses.stages_status
    - stages.each do |stage|
      %td
        - status = stages_status[stage]
        - tooltip = "#{stage.titleize}: #{status || 'not found'}"
        - if status
          = link_to namespace_project_pipeline_path(@project.namespace, @project, pipeline.id, anchor: stage), class: "has-tooltip ci-status-icon-#{status}", title: tooltip do
            = ci_icon_for_status(status)
        - else
          .light.has-tooltip{ title: tooltip }
            \-

  %td
    - if pipeline.started_at && pipeline.finished_at
      %p.duration
        #{duration_in_words(pipeline.finished_at, pipeline.started_at)}

  %td
    .controls.hidden-xs.pull-right
      - artifacts = pipeline.builds.latest.select { |b| b.artifacts? }
      - if artifacts.present?
        .dropdown.inline.build-artifacts
          %button.dropdown-toggle.btn{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 #{build.name}

      - if can?(current_user, :update_pipeline, @project)
        - 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")