show.html.haml 5.9 KB
Newer Older
1
- @no_container = true
2 3
- add_to_breadcrumbs "Jobs", project_jobs_path(@project)
- breadcrumb_title "##{@build.id}"
4
- page_title "#{@build.name} (##{@build.id})", "Jobs"
K
Kamil Trzcinski 已提交
5

6
%div{ class: container_class }
7 8
  .build-page.js-build-page
    #js-build-header-vue
9 10
    - if @build.stuck?
      - unless @build.any_runners_online?
F
Filipa Lacerda 已提交
11
        .bs-callout.bs-callout-warning.js-build-stuck
12 13
          %p
            - if no_runners_for_project?(@build.project)
F
Filipa Lacerda 已提交
14
              This job is stuck, because the project doesn't have any runners online assigned to it.
15
            - elsif @build.tags.any?
F
Filipa Lacerda 已提交
16
              This job is stuck, because you don't have any active runners online with any of these tags assigned to them:
17 18 19 20
              - @build.tags.each do |tag|
                %span.label.label-primary
                  = tag
            - else
F
Filipa Lacerda 已提交
21
              This job is stuck, because you don't have any active runners that can run this job.
22

23 24
            %br
            Go to
25
            = link_to project_runners_path(@build.project) do
26
              Runners page
27

28
    - if @build.starts_environment?
F
Filipa Lacerda 已提交
29
      .prepend-top-default.js-environment-container
30
        .environment-information
31
          - if @build.outdated_deployment?
A
Annabel Dunstone Gray 已提交
32 33 34
            = ci_icon_for_status('success_with_warnings')
          - else
            = ci_icon_for_status(@build.status)
35

36 37 38
          - environment = environment_for_build(@build.project, @build)
          - if @build.success? && @build.last_deployment.present?
            - if @build.last_deployment.last?
39
              This job is the most recent deployment to #{environment_link_for_build(@build.project, @build)}.
40
            - else
41
              This job is an out-of-date deployment to #{environment_link_for_build(@build.project, @build)}.
K
Kamil Trzcinski 已提交
42
              View the most recent deployment #{deployment_link(environment.last_deployment)}.
43
          - elsif @build.complete? && !@build.success?
44
            The deployment of this job to #{environment_link_for_build(@build.project, @build)} did not succeed.
45
          - else
46
            This job is creating a deployment to #{environment_link_for_build(@build.project, @build)}
47
            - if environment.try(:last_deployment)
F
Filipa Lacerda 已提交
48
              and will overwrite the #{deployment_link(environment.last_deployment, text: 'latest deployment')}
49

50 51
    - if @build.erased?
      .prepend-top-default.js-build-erased
52
        .erased.alert.alert-warning
R
Rémy Coutable 已提交
53
          - if @build.erased_by_user?
54
            Job has been erased by #{link_to(@build.erased_by_name, user_path(@build.erased_by))} #{time_ago_with_tooltip(@build.erased_at)}
R
Rémy Coutable 已提交
55
          - else
56
            Job has been erased #{time_ago_with_tooltip(@build.erased_at)}
57 58 59 60 61 62
    - if @build.started?
      .build-trace-container.prepend-top-default
        .top-bar.js-top-bar
          .js-truncated-info.truncated-info.hidden-xs.pull-left.hidden<
            Showing last
            %span.js-truncated-info-size.truncated-info-size><
63
            of log -
64
            %a.js-raw-link.raw-link{ href: raw_project_job_path(@project, @build) }>< Complete Raw
F
Filipa Lacerda 已提交
65

66 67 68 69 70 71 72
          .controllers.pull-right
            - if @build.has_trace?
              = link_to raw_project_job_path(@project, @build),
                      title: 'Show complete raw',
                      data: { placement: 'top', container: 'body' },
                      class: 'js-raw-link-controller has-tooltip controllers-buttons' do
                = icon('file-text-o')
73

74 75 76 77 78 79 80 81 82 83 84 85 86
            - if @build.erasable? && can?(current_user, :erase_build, @build)
              = link_to erase_project_job_path(@project, @build),
                        method: :post,
                        data: { confirm: 'Are you sure you want to erase this build?', placement: 'top', container: 'body' },
                        title: 'Erase job log',
                        class: 'has-tooltip js-erase-link controllers-buttons' do
                = icon('trash')
            .has-tooltip.controllers-buttons{ title: 'Scroll to top', data: { placement: 'top', container: 'body'} }
              %button.js-scroll-up.btn-scroll.btn-transparent.btn-blank{ type: 'button', disabled: true }
                = custom_icon('scroll_up')
            .has-tooltip.controllers-buttons{ title: 'Scroll to bottom', data: { placement: 'top', container: 'body'} }
              %button.js-scroll-down.btn-scroll.btn-transparent.btn-blank{ type: 'button', disabled: true }
                = custom_icon('scroll_down')
87

88 89 90
        %pre.build-trace#build-trace
          %code.bash.js-build-output
          .build-loader-animation.js-build-refresh
F
Filipa Lacerda 已提交
91 92 93 94 95
    - elsif @build.playable?
      = render 'empty_state',
        illustration: 'illustrations/manual_action.svg',
        illustration_size: 'svg-394',
        title: _('This job requires a manual action'),
96 97
        content: _('This job depends on a user to trigger its process. Often they are used to deploy code to production environments'),
        action: ( link_to _('Trigger this manual action'), play_project_job_path(@project, @build), method: :post, class: 'btn btn-primary', title: _('Trigger this manual action') )
98
    - elsif @build.created?
F
Filipa Lacerda 已提交
99 100 101
      = render 'empty_state',
        illustration: 'illustrations/job_not_triggered.svg',
        illustration_size: 'svg-306',
102
        title: _('This job has not been triggered yet'),
103 104 105 106 107 108
        content: _('This job depends on upstream jobs that need to succeed in order for this job to be triggered')
    - else
      = render 'empty_state',
        illustration: 'illustrations/job_not_triggered.svg',
        illustration_size: 'svg-306',
        title: _('This job has not started yet'),
109
        content: _('This job is in pending state and is waiting to be picked by a runner')
110
  = render "sidebar"
111

112
.js-build-options{ data: javascript_build_options }
113

114
#js-job-details-vue{ data: { endpoint: project_job_path(@project, @build, format: :json) } }
115 116 117 118

- content_for :page_specific_javascripts do
  = webpack_bundle_tag('common_vue')
  = webpack_bundle_tag('job_details')