summaryrefslogtreecommitdiff
path: root/app/views/projects/commit/_pipeline.html.haml
blob: 0c006656d1db7ca836d60cf3f400347c784c70f9 (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
.row-content-block.build-content.middle-block.pipeline-graph
  .pipeline-visualization
    %ul.stage-column-list
      - pipeline.statuses.stages.each do |stage|
        - statuses = pipeline.statuses.where(stage: stage)
        - status = statuses.latest.status
        %li.stage-column
          .stage-name
            %a{name: stage}
            - if stage
              = stage.titleize
          .builds-container
            %ul
              - statuses.each do |build|
                %li.build
                  .build-content
                    %span{class: "ci-status-link ci-status-icon-#{status}"}
                      = ci_icon_for_status(status)
                    = build.name

.row-content-block.build-content.middle-block.pipeline-graph
  .pull-right
    - if can?(current_user, :update_pipeline, pipeline.project)
      - if pipeline.builds.latest.failed.any?(&:retryable?)
        = link_to "Retry failed", retry_namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), class: 'btn btn-grouped btn-primary', method: :post

      - if pipeline.builds.running_or_pending.any?
        = link_to "Cancel running", cancel_namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), data: { confirm: 'Are you sure?' }, class: 'btn btn-grouped btn-danger', method: :post

  .oneline.clearfix
    - if defined?(pipeline_details) && pipeline_details
      Pipeline
      = link_to "##{pipeline.id}", namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), class: "monospace"
      with
      = pluralize pipeline.statuses.count(:id), "build"
      - if pipeline.ref
        for
        = link_to pipeline.ref, namespace_project_commits_path(pipeline.project.namespace, pipeline.project, pipeline.ref), class: "monospace"
      - if defined?(link_to_commit) && link_to_commit
        for commit
        = link_to pipeline.short_sha, namespace_project_commit_path(pipeline.project.namespace, pipeline.project, pipeline.sha), class: "monospace"
      - if pipeline.duration
        in
        = time_interval_in_words pipeline.duration

- if pipeline.yaml_errors.present?
  .bs-callout.bs-callout-danger
    %h4 Found errors in your .gitlab-ci.yml:
    %ul
      - pipeline.yaml_errors.split(",").each do |error|
        %li= error
    You can also test your .gitlab-ci.yml in the #{link_to "Lint", ci_lint_path}

- if pipeline.project.builds_enabled? && !pipeline.ci_yaml_file
  .bs-callout.bs-callout-warning
    \.gitlab-ci.yml not found in this commit

.table-holder.pipeline-holder
  %table.table.builds.pipeline
    %thead
      %tr
        %th Status
        %th Build ID
        %th Name
        %th
        - if pipeline.project.build_coverage_enabled?
          %th Coverage
        %th
    - pipeline.statuses.stages.each do |stage|
      = render 'projects/commit/ci_stage', stage: stage, statuses: pipeline.statuses.where(stage: stage)