Welcome to mirror list, hosted at ThFree Co, Russian Federation.

notify.gitlab-ci.yml « ci « .gitlab - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 51b0f4071eb8545646d38ddd49d05adef4f43e96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.notify-slack:
  image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}alpine/curl
  stage: notify
  dependencies: []
  cache: {}
  variables:
    MERGE_REQUEST_URL: ${CI_MERGE_REQUEST_PROJECT_URL}/-/merge_requests/${CI_MERGE_REQUEST_IID}
  before_script:
    - apk update && apk add git bash
    - echo "NOTIFY_CHANNEL is ${NOTIFY_CHANNEL}"
    - echo "CI_PIPELINE_URL is ${CI_PIPELINE_URL}"

notify-update-gitaly:
  extends:
    - .notify-slack
  rules:
    - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $GITALY_UPDATE_BRANCH'
      when: on_failure
      allow_failure: true
  variables:
    NOTIFY_CHANNEL: g_gitaly
    GITALY_UPDATE_BRANCH: release-tools/update-gitaly
  script:
    - scripts/slack ${NOTIFY_CHANNEL} "☠️ \`${GITALY_UPDATE_BRANCH}\` failed! ☠️ See ${CI_PIPELINE_URL} (triggered from ${MERGE_REQUEST_URL})" ci_failing "GitLab QA Bot"

notify-security-pipeline:
  extends:
    - .notify-slack
    - .delivery:rules:security-pipeline-merge-result-failure
  variables:
    NOTIFY_CHANNEL: f_upcoming_release
  script:
    # <!subteam^S0127FU8PDE> mentions the `@release-managers` group
    - scripts/slack ${NOTIFY_CHANNEL} "<!subteam^S0127FU8PDE> ☠️  Pipeline for merged result failed! ☠️ See ${CI_PIPELINE_URL} (triggered from ${MERGE_REQUEST_URL})" ci_failing "GitLab Release Tools Bot"

notify-pipeline-failure:
  extends: .notify-slack
  image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}ruby:${RUBY_VERSION}
  rules:
    # Don't report child pipeline failures
    - if: '$CI_PIPELINE_SOURCE == "parent_pipeline"'
      when: never
    - if: '$CI_SLACK_WEBHOOK_URL && $NOTIFY_PIPELINE_FAILURE_CHANNEL'
      when: on_failure
      allow_failure: true
  variables:
    SLACK_CHANNEL: "${NOTIFY_PIPELINE_FAILURE_CHANNEL}"
    FAILED_PIPELINE_REPORT_FILE: "failed_pipeline_report.json"
  before_script:
    - source scripts/utils.sh
    - apt-get update && apt-get install -y jq
    - install_gitlab_gem
  script:
    - scripts/generate-failed-pipeline-slack-message.rb
    - |
      curl -X POST -H 'Content-Type: application/json' --data @${FAILED_PIPELINE_REPORT_FILE} "$CI_SLACK_WEBHOOK_URL"
  artifacts:
    paths:
      - ${FAILED_PIPELINE_REPORT_FILE}
    when: always
    expire_in: 2 days