show.html.haml 6.1 KB
Newer Older
K
Kamil Trzcinski 已提交
1 2 3
- page_title "#{@build.name} (#{@build.id})", "Builds"
= render "header_title"

4 5
.build-page
  .gray-content-block
K
Kamil Trzcinski 已提交
6
    Build ##{@build.id} for commit
7 8 9
    %strong.monospace
      = link_to @build.commit.short_sha, ci_status_path(@build.commit)
    from
K
Kamil Trzcinski 已提交
10
    = link_to @build.ref, namespace_project_commits_path(@project.namespace, @project, @build.ref)
11 12

  #up-build-trace
K
Kamil Trzcinski 已提交
13
  - if @commit.matrix_for_ref?(@build.ref)
14
    %ul.center-top-menu.build-top-menu
15
      - @commit.latest_builds_for_ref(@build.ref).each do |build|
16 17 18 19 20 21 22 23 24 25
        %li{class: ('active' if build == @build) }
          = link_to namespace_project_build_path(@project.namespace, @project, build) do
            = ci_icon_for_status(build.status)
            %span
              - if build.name
                = build.name
              - else
                = build.id


K
Kamil Trzcinski 已提交
26
      - if @build.retried?
27 28 29 30
        %li.active
          %a
            Build ##{@build.id}
            ·
K
Kamil Trzcinski 已提交
31
            %i.fa.fa-warning
32 33 34 35 36 37 38 39 40 41 42
            This build was retried.

  .gray-content-block.second-block
    .build-head
      .clearfix
        = ci_status_with_icon(@build.status)
        - if @build.duration
          %span
            %i.fa.fa-time
            #{duration_in_words(@build.finished_at, @build.started_at)}
        .pull-right
K
Kamil Trzcinski 已提交
43
          #{time_ago_with_tooltip(@build.finished_at) if @build.finished_at}
44

45 46 47 48 49
  - if @build.show_warning?
    - unless @build.any_runners_online?
      .bs-callout.bs-callout-warning
        %p
          - if no_runners_for_project?(@build.project)
K
Kamil Trzcinski 已提交
50
            This build is stuck, because the project doesn't have any runners online assigned to it.
51
          - elsif @build.tags.any?
52
            This build is stuck, because you don't have any active runners online with any of these tags assigned to them:
53 54 55 56
            - @build.tags.each do |tag|
              %span.label.label-primary
                = tag
          - else
57
            This build is stuck, because you don't have any active runners that can run this build.
58 59 60 61 62 63

          %br
          Go to
          = link_to namespace_project_runners_path(@build.gl_project.namespace, @build.gl_project) do
            Runners page

64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
  .row.prepend-top-default
    .col-md-9
      .clearfix
        - if @build.active?
          .autoscroll-container
            %button.btn.btn-success.btn-sm#autoscroll-button{:type => "button", :data => {:state => 'disabled'}} enable autoscroll
          .clearfix
      .scroll-controls
        = link_to '#up-build-trace', class: 'btn' do
          %i.fa.fa-angle-up
        = link_to '#down-build-trace', class: 'btn' do
          %i.fa.fa-angle-down

      %pre.trace#build-trace
        %code.bash
          = preserve do
            = raw @build.trace_html
      %div#down-build-trace

    .col-md-3
      - if @build.coverage
        .build-widget
          %h4.title
            Test coverage
          %h1 #{@build.coverage}%

K
Kamil Trzcinski 已提交
90 91 92
      - if current_user && can?(current_user, :download_build_artifacts, @project) && @build.download_url
        .build-widget.center
          = link_to "Download artifacts", @build.download_url, class: 'btn btn-sm btn-primary'
93 94 95

      .build-widget
        %h4.title
K
Kamil Trzcinski 已提交
96
          Build ##{@build.id}
97 98
          - if current_user && can?(current_user, :manage_builds, @project)
            .pull-right
K
Kamil Trzcinski 已提交
99 100 101 102
              - if @build.cancel_url
                = link_to "Cancel", @build.cancel_url, class: 'btn btn-sm btn-danger', method: :post
              - elsif @build.retry_url
                = link_to "Retry", @build.retry_url, class: 'btn btn-sm btn-primary', method: :post
103 104 105 106 107 108 109

        - if @build.duration
          %p
            %span.attr-name Duration:
            #{duration_in_words(@build.finished_at, @build.started_at)}
        %p
          %span.attr-name Created:
K
Kamil Trzcinski 已提交
110
          #{time_ago_with_tooltip(@build.created_at)}
111 112 113
        - if @build.finished_at
          %p
            %span.attr-name Finished:
K
Kamil Trzcinski 已提交
114
            #{time_ago_with_tooltip(@build.finished_at)}
115 116 117
        %p
          %span.attr-name Runner:
          - if @build.runner && current_user && current_user.admin
K
Kamil Trzcinski 已提交
118
            = link_to "##{@build.runner.id}", ci_admin_runner_path(@build.runner.id)
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
          - elsif @build.runner
            \##{@build.runner.id}

      - if @build.trigger_request
        .build-widget
          %h4.title
            Trigger

          %p
            %span.attr-name Token:
            #{@build.trigger_request.trigger.short_token}

          - if @build.trigger_request.variables
            %p
              %span.attr-name Variables:

            %code
              - @build.trigger_request.variables.each do |key, value|
                #{key}=#{value}

      .build-widget
        %h4.title
          Commit
          .pull-right
K
Kamil Trzcinski 已提交
143 144
            %small 
              = link_to @build.commit.short_sha, ci_status_path(@build.commit), class: "monospace"
145 146
        %p
          %span.attr-name Branch:
K
Kamil Trzcinski 已提交
147
          = link_to @build.ref, namespace_project_commits_path(@project.namespace, @project, @build.ref)
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
        %p
          %span.attr-name Author:
          #{@build.commit.git_author_name}
        %p
          %span.attr-name Message:
          #{@build.commit.git_commit_message}

      - if @build.tags.any?
        .build-widget
          %h4.title
            Tags
          - @build.tag_list.each do |tag|
            %span.label.label-primary
              = tag

      - if @builds.present?
        .build-widget
K
Kamil Trzcinski 已提交
165 166 167
          %h4.title #{pluralize(@builds.count(:id), "other build")} for 
          = succeed ":" do
            = link_to @build.commit.short_sha, ci_status_path(@build.commit), class: "monospace"
168 169 170 171 172 173
          %table.table.builds
            - @builds.each_with_index do |build, i|
              %tr.build
                %td
                  = ci_icon_for_status(build.status)
                %td
A
Andy Brandt 已提交
174
                  = link_to namespace_project_build_path(@project.namespace, @project, build) do
175 176 177 178 179 180 181 182 183
                    - if build.name
                      = build.name
                    - else
                      %span ##{build.id}

                %td.status= build.status


  :javascript
K
Kamil Trzcinski 已提交
184
    new CiBuild("#{namespace_project_build_url(@project.namespace, @project, @build)}", "#{@build.status}")