BigW Consortium Gitlab

_heading.html.haml 2.72 KB
Newer Older
1
- if @pipeline
2
  .mr-widget-heading
3 4 5 6 7 8 9 10 11 12 13 14
    - %w[success success_with_warnings skipped canceled failed running pending].each do |status|
      .ci_widget{ class: "ci-#{status}", style: ("display:none" unless @pipeline.status == status) }
        = ci_icon_for_status(status)
        %span
          CI build
          = ci_label_for_status(status)
        for
        - commit = @merge_request.diff_head_commit
        = succeed "." do
          = link_to @pipeline.short_sha, namespace_project_commit_path(@merge_request.source_project.namespace, @merge_request.source_project, @pipeline.sha), class: "monospace"
        %span.ci-coverage
        = link_to "View details", builds_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: "js-show-tab", data: {action: 'builds'}
15 16

- elsif @merge_request.has_ci?
17 18
  - # Compatibility with old CI integrations (ex jenkins) when you request status from CI server via AJAX
  - # Remove in later versions when services like Jenkins will set CI status via Commit status API
19
  .mr-widget-heading
20
    - %w[success skipped canceled failed running pending].each do |status|
21
      .ci_widget{class: "ci-#{status}", style: "display:none"}
22 23 24 25
        = ci_icon_for_status(status)
        %span
          CI build
          = ci_label_for_status(status)
26
        for
27
        - commit = @merge_request.diff_head_commit
28 29
        = succeed "." do
          = link_to commit.short_id, namespace_project_commit_path(@merge_request.source_project.namespace, @merge_request.source_project, commit), class: "monospace"
30
        %span.ci-coverage
31
        - if details_path = ci_build_details_path(@merge_request)
32
          = link_to "View details", details_path, :"data-no-turbolink" => "data-no-turbolink"
33

34 35
    .ci_widget
      = icon("spinner spin")
36
      Checking CI status for #{@merge_request.diff_head_commit.short_id}…
37 38 39

    .ci_widget.ci-not_found{style: "display:none"}
      = icon("times-circle")
40
      Could not find CI status for #{@merge_request.diff_head_commit.short_id}.
41 42 43

    .ci_widget.ci-error{style: "display:none"}
      = icon("times-circle")
44
      Could not connect to the CI server. Please check your settings and try again.
45 46 47

- @merge_request.environments.each do |environment|
  .mr-widget-heading
48
    .ci_widget.ci-success
49
      = ci_icon_for_status("success")
50
      %span.hidden-sm
51 52 53
        Deployed to
        = succeed '.' do
          = link_to environment.name, namespace_project_environment_path(@project.namespace, @project, environment), class: 'environment'
54 55
        - external_url = environment.external_url
        - if external_url
56 57
          = link_to external_url, target: '_blank' do
            = icon('external-link', text: "View on #{external_url.gsub(/\A.*?:\/\//, '')}", right: true)