Skip to content

Commit

Permalink
Placeholder
Browse files Browse the repository at this point in the history
Signed-off-by: Dilyan Marinov <[email protected]>
  • Loading branch information
Dilyan Marinov committed Jun 28, 2023
1 parent 0918a53 commit ac3de42
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ stages:
- release
- release_image
- end
- notify

build-check-prerequisites:
stage: build
Expand All @@ -37,3 +38,13 @@ end:
only:
refs:
- external_pull_requests

notify_failure:
stage: notify
script:
- ./cicd/notify.sh "The pipeline for branch `$CI_COMMIT_BRANCH` has failed.\n Please take the necessary steps to fix it. https://gitlab.com/vmware-analytics/versatile-data-kit/-/pipelines/$CI_PIPELINE_ID" $VDK_SLACK_NOTIFICATION_HOOK
rules:
- if: '$CI_COMMIT_BRANCH != "person/mdilyan/notify-on-main-failure"'
when: never
- if: '$CI_COMMIT_BRANCH == "person/mdilyan/notify-on-main-failure"'
when: on_success
5 changes: 5 additions & 0 deletions cicd/notify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash -e
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$1\"}" $2

0 comments on commit ac3de42

Please sign in to comment.