show.html.haml 4.62 KB
Newer Older
1 2
#up-build-trace
- if @commit.matrix?
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
3
  %ul.center-top-menu
4 5
    - @commit.builds_without_retry_sorted.each do |build|
      %li{class: ('active' if build == @build) }
6
        = link_to ci_project_build_url(@project, build) do
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
7
          = ci_icon_for_status(build.status)
8 9 10
          %span
            - if build.name
              = build.name
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
11 12 13
            - else
              = build.id

14 15 16 17 18 19

    - unless @commit.builds_without_retry.include?(@build)
      %li.active
        %a
          Build ##{@build.id}
          ·
20
          %i.fa.fa-warning-sign
21 22
          This build was retried.

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
23 24 25 26 27 28 29 30 31 32
.gray-content-block
  .build-head
    %h4
      - if @build.commit.tag?
        Build for tag
        %code #{@build.ref}
      - else
        Build for commit
        %strong.monospace= commit_link(@build.commit)
        from
33

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
34 35
        = link_to ci_project_path(@build.project, ref: @build.ref) do
          %strong.monospace= "#{@build.ref}"
36

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
37 38 39 40 41
      - if @build.duration
        .pull-right
          %span
            %i.fa.fa-time
            #{duration_in_words(@build.finished_at, @build.started_at)}
42

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
43 44 45 46
    .clearfix
      = ci_status_with_icon(@build.status)
      .pull-right
        = @build.updated_at.stamp('19:00 Aug 27')
47

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
48 49
.row.prepend-top-default
  .col-md-9
50 51 52 53 54 55 56
    .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
57
        %i.fa.fa-angle-up
58
      = link_to '#down-build-trace', class: 'btn' do
59
        %i.fa.fa-angle-down
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77

    %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}%


    .build-widget
      %h4.title
        Build
78
        - if current_user && can?(current_user, :manage_builds, gl_project)
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
          .pull-right
            - if @build.active?
              = link_to "Cancel", cancel_ci_project_build_path(@project, @build), class: 'btn btn-sm btn-danger'
            - elsif @build.commands.present?
              = link_to "Retry", retry_ci_project_build_path(@project, @build), class: 'btn btn-sm btn-primary', method: :post

      - if @build.duration
        %p
          %span.attr-name Duration:
          #{duration_in_words(@build.finished_at, @build.started_at)}
      %p
        %span.attr-name Created:
        #{time_ago_in_words(@build.created_at)} ago
      - if @build.finished_at
        %p
          %span.attr-name Finished:
          #{time_ago_in_words(@build.finished_at)} ago
      %p
        %span.attr-name Runner:
98
        - if @build.runner && current_user && current_user.admin
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
          \#{link_to "##{@build.runner.id}", ci_admin_runner_path(@build.runner.id)}
        - 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
          %small #{build_commit_link @build}

      - if @build.commit.compare?
        %p
          %span.attr-name Compare:
          #{build_compare_link @build}
      %p
        %span.attr-name Branch:
        #{build_ref_link @build}
      %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
        %h4.title #{pluralize(@builds.count, "other build")} for #{@build.short_sha}:
        %table.builds
          - @builds.each_with_index do |build, i|
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
153
            %tr.build
154
              %td
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
155
                = ci_icon_for_status(build.status)
156
              %td
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
157 158 159 160 161 162
                = link_to ci_project_build_url(@project, build) do
                  - if build.name
                    = build.name
                  - else
                    %span ##{build.id}

163 164 165 166 167 168 169
              %td.status= build.status


        = paginate @builds


:javascript
170
  new CiBuild("#{ci_project_build_url(@project, @build)}", "#{@build.status}")