_builds.html.haml 2.5 KB
Newer Older
D
Douwe Maan 已提交
1 2
.gray-content-block.middle-block
  .pull-right
3
    - if can?(current_user, :update_build, @ci_commit.project)
D
Douwe Maan 已提交
4
      - if @ci_commit.builds.latest.failed.any?(&:retryable?)
K
Kamil Trzcinski 已提交
5
        = link_to "Retry failed", retry_builds_namespace_project_commit_path(@ci_commit.project.namespace, @ci_commit.project, @ci_commit.sha), class: 'btn btn-grouped btn-primary', method: :post
D
Douwe Maan 已提交
6 7

      - if @ci_commit.builds.running_or_pending.any?
K
Kamil Trzcinski 已提交
8
        = link_to "Cancel running", cancel_builds_namespace_project_commit_path(@ci_commit.project.namespace, @ci_commit.project, @ci_commit.sha), data: { confirm: 'Are you sure?' }, class: 'btn btn-grouped btn-danger', method: :post
D
Douwe Maan 已提交
9 10 11 12 13

  .oneline
    = pluralize @statuses.count(:id), "build"
    - if defined?(link_to_commit) && link_to_commit
      for commit
K
Kamil Trzcinski 已提交
14
      = link_to @ci_commit.short_sha, namespace_project_commit_path(@ci_commit.project.namespace, @ci_commit.project, @ci_commit.sha), class: "monospace"
D
Douwe Maan 已提交
15 16 17 18 19 20 21 22 23 24
    - if @ci_commit.duration > 0
      in
      = time_interval_in_words @ci_commit.duration

- if @ci_commit.yaml_errors.present?
  .bs-callout.bs-callout-danger
    %h4 Found errors in your .gitlab-ci.yml:
    %ul
      - @ci_commit.yaml_errors.split(",").each do |error|
        %li= error
K
Kamil Trzcinski 已提交
25
    You can also test your .gitlab-ci.yml in the #{link_to "Lint", ci_lint_path}
D
Douwe Maan 已提交
26

K
Kamil Trzcinski 已提交
27
- if @ci_commit.project.builds_enabled? && !@ci_commit.ci_yaml_file
D
Douwe Maan 已提交
28 29 30 31 32 33 34 35 36 37 38 39 40 41
  .bs-callout.bs-callout-warning
    \.gitlab-ci.yml not found in this commit

.table-holder
  %table.table.builds
    %thead
      %tr
        %th Status
        %th Build ID
        %th Ref
        %th Stage
        %th Name
        %th Duration
        %th Finished at
K
Kamil Trzcinski 已提交
42
        - if @ci_commit.project.build_coverage_enabled?
D
Douwe Maan 已提交
43 44 45 46
          %th Coverage
        %th
    - @ci_commit.refs.each do |ref|
      = render partial: "projects/commit_statuses/commit_status", collection: @ci_commit.statuses.for_ref(ref).latest.ordered,
K
Kamil Trzcinski 已提交
47
               locals: { coverage: @ci_commit.project.build_coverage_enabled?, stage: true, allow_retry: true }
D
Douwe Maan 已提交
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63

- if @ci_commit.retried.any?
  .gray-content-block.second-block
    Retried builds

  .table-holder
    %table.table.builds
      %thead
        %tr
          %th Status
          %th Build ID
          %th Ref
          %th Stage
          %th Name
          %th Duration
          %th Finished at
K
Kamil Trzcinski 已提交
64
          - if @ci_commit.project.build_coverage_enabled?
D
Douwe Maan 已提交
65 66 67
            %th Coverage
          %th
      = render partial: "projects/commit_statuses/commit_status", collection: @ci_commit.retried,
K
Kamil Trzcinski 已提交
68
               locals: { coverage: @ci_commit.project.build_coverage_enabled?, stage: true }