Skip to content

Commit 69c7348

Browse files
committed
chore: notify slack on build failure
1 parent 4416274 commit 69c7348

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ jobs:
4242
IMAGE_NAME_APPROVED=snyk/kubernetes-monitor:${NEW_VERSION}-approved &&
4343
docker tag ${IMAGE_NAME_CANDIDATE} ${IMAGE_NAME_APPROVED} &&
4444
docker push ${IMAGE_NAME_APPROVED} &&
45-
./scripts/slack-notify-push.sh ${IMAGE_NAME_APPROVED}
45+
./scripts/slack-notify-push.sh ${IMAGE_NAME_APPROVED} ||
46+
./scripts/slack-notify-failure.sh staging
4647
name: Test and Build
4748
######################## PR TO MASTER ########################
4849
- stage: pre-publish
@@ -63,7 +64,8 @@ jobs:
6364
./scripts/slack-notify-push.sh ${IMAGE_NAME_PUBLISHED} &&
6465
docker tag ${IMAGE_NAME_APPROVED} snyk/kubernetes-monitor:latest &&
6566
docker push ${IMAGE_NAME_PUBLISHED} &&
66-
./scripts/slack-notify-push.sh snyk/kubernetes-monitor:latest
67+
./scripts/slack-notify-push.sh snyk/kubernetes-monitor:latest ||
68+
./scripts/slack-notify-failure.sh master
6769
name: publish the kubernetes-monitor (npm, container, helm)
6870
branches:
6971
only:

scripts/slack-notify-failure.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#! /bin/bash
2+
curl -X POST -H 'Content-Type:application/json' -d '{"attachments": [{"color": "warning", "fallback": "Build Notification: $TRAVIS_BUILD_WEB_URL", "title": ":warning: Kubernetes-Monitor Merge Failure :warning:", "text": ":egg_broken_1: Kubernetes-Monitor broken branch: `'$1'` :egg_broken_1:"}]}' $SLACK_WEBHOOK

0 commit comments

Comments
 (0)