diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /.gitlab/ci/notify.gitlab-ci.yml | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to '.gitlab/ci/notify.gitlab-ci.yml')
-rw-r--r-- | .gitlab/ci/notify.gitlab-ci.yml | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/.gitlab/ci/notify.gitlab-ci.yml b/.gitlab/ci/notify.gitlab-ci.yml index 95318d5ce08..51b0f4071eb 100644 --- a/.gitlab/ci/notify.gitlab-ci.yml +++ b/.gitlab/ci/notify.gitlab-ci.yml @@ -1,12 +1,12 @@ .notify-slack: - image: ${GITLAB_DEPENDENCY_PROXY}alpine + 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 curl bash + - apk update && apk add git bash - echo "NOTIFY_CHANNEL is ${NOTIFY_CHANNEL}" - echo "CI_PIPELINE_URL is ${CI_PIPELINE_URL}" @@ -34,13 +34,28 @@ notify-security-pipeline: - 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 + extends: .notify-slack + image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}ruby:${RUBY_VERSION} rules: - - if: '$NOTIFY_PIPELINE_FAILURE_CHANNEL' + # 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: - NOTIFY_CHANNEL: "${NOTIFY_PIPELINE_FAILURE_CHANNEL}" + 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/slack ${NOTIFY_CHANNEL} "❌ \`${CI_COMMIT_REF_NAME}\` pipeline failed! See ${CI_PIPELINE_URL}" ci_failing "notify-pipeline-failure" + - 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 |