Skip to content

Commit 05da06c

Browse files
authored
Merge pull request #604 from snyk/feat/podspec-from-pods
chore: fix Slack notifications on failed CI jobs
2 parents 8f537df + 13f21d6 commit 05da06c

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

.circleci/config.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ jobs:
117117
https://my.dev.snyk.io/${DEV_DEPLOY_TOKEN}
118118
name: Deploy to dev
119119
- run:
120-
command: ./scripts/slack/notify_failure.py "deploy-dev"
120+
command: ./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
121121
name: Notify Slack on failure
122122
when: on_fail
123123
working_directory: ~/kubernetes-monitor
@@ -140,7 +140,7 @@ jobs:
140140
https://my.prod.snyk.io/${PROD_DEPLOY_TOKEN}
141141
name: Deploy to prod
142142
- run:
143-
command: ./scripts/slack/notify_failure.py "deploy-prod"
143+
command: ./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
144144
name: Notify Slack on failure
145145
when: on_fail
146146
working_directory: ~/kubernetes-monitor
@@ -295,7 +295,7 @@ jobs:
295295
npm run test:integration:openshift3:yaml
296296
name: Integration tests OpenShift 3
297297
- run:
298-
command: ./scripts/slack/notify_failure.py "staging-openshift3-integration-tests-${CIRCLE_SHA1}"
298+
command: ./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
299299
name: Notify Slack on failure
300300
when: on_fail
301301
- store_artifacts:
@@ -526,7 +526,7 @@ jobs:
526526
- run:
527527
command: |
528528
if [[ "${NOTHING_TO_TEST}" != "true" ]]; then
529-
./scripts/slack/notify_failure.py "nightly-operator-upgrade-tests"
529+
./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
530530
fi
531531
name: Notify Slack on failure
532532
when: on_fail
@@ -571,7 +571,7 @@ jobs:
571571
python3 scripts/operator/create_operator_and_push.py "${OPERATOR_TAG}" "${MONITOR_TAG}" "${DOCKERHUB_USER}" "${DOCKERHUB_PASSWORD}"
572572
name: Create Operator and push Operator image to DockerHub
573573
- run:
574-
command: ./scripts/slack/notify_failure.py "master"
574+
command: ./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
575575
name: Notify Slack on failure
576576
when: on_fail
577577
working_directory: ~/kubernetes-monitor
@@ -634,7 +634,7 @@ jobs:
634634
- run:
635635
command: |
636636
if [[ "${NOTHING_TO_TEST}" != "true" ]]; then
637-
./scripts/slack/notify_failure.py "push-new-operator on community-operators"
637+
./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
638638
fi
639639
name: Notify Slack on failure
640640
when: on_fail
@@ -698,7 +698,7 @@ jobs:
698698
- run:
699699
command: |
700700
if [[ "${NOTHING_TO_TEST}" != "true" ]]; then
701-
./scripts/slack/notify_failure.py "push-new-operator on upstream-community-operators"
701+
./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
702702
fi
703703
name: Notify Slack on failure
704704
when: on_fail
@@ -757,7 +757,7 @@ jobs:
757757
./scripts/docker/approve-image.sh $NEW_VERSION
758758
name: Tag and push
759759
- run:
760-
command: ./scripts/slack/notify_failure.py "staging-release"
760+
command: ./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
761761
name: Notify Slack on failure
762762
when: on_fail
763763
working_directory: ~/kubernetes-monitor

.circleci/config/jobs/@jobs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ openshift3_integration_tests:
259259
npm run test:integration:openshift3:yaml
260260
- run:
261261
name: Notify Slack on failure
262-
command: ./scripts/slack/notify_failure.py "staging-openshift3-integration-tests-${CIRCLE_SHA1}"
262+
command: ./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
263263
when: on_fail
264264
- store_artifacts:
265265
path: /tmp/logs/test/integration/openshift3
@@ -325,7 +325,7 @@ tag_and_push:
325325
./scripts/docker/approve-image.sh $NEW_VERSION
326326
- run:
327327
name: Notify Slack on failure
328-
command: ./scripts/slack/notify_failure.py "staging-release"
328+
command: ./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
329329
when: on_fail
330330

331331
deploy_dev:
@@ -350,7 +350,7 @@ deploy_dev:
350350
https://my.dev.snyk.io/${DEV_DEPLOY_TOKEN}
351351
- run:
352352
name: Notify Slack on failure
353-
command: ./scripts/slack/notify_failure.py "deploy-dev"
353+
command: ./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
354354
when: on_fail
355355

356356
######################## MERGE TO MASTER ########################
@@ -396,7 +396,7 @@ publish:
396396
python3 scripts/operator/create_operator_and_push.py "${OPERATOR_TAG}" "${MONITOR_TAG}" "${DOCKERHUB_USER}" "${DOCKERHUB_PASSWORD}"
397397
- run:
398398
name: Notify Slack on failure
399-
command: ./scripts/slack/notify_failure.py "master"
399+
command: ./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
400400
when: on_fail
401401

402402
deploy_prod:
@@ -420,5 +420,5 @@ deploy_prod:
420420
https://my.prod.snyk.io/${PROD_DEPLOY_TOKEN}
421421
- run:
422422
name: Notify Slack on failure
423-
command: ./scripts/slack/notify_failure.py "deploy-prod"
423+
command: ./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
424424
when: on_fail

.circleci/config/jobs/operator_upgrade_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,6 @@ steps:
212212
name: Notify Slack on failure
213213
command: |
214214
if [[ "${NOTHING_TO_TEST}" != "true" ]]; then
215-
./scripts/slack/notify_failure.py "nightly-operator-upgrade-tests"
215+
./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
216216
fi
217217
when: on_fail

.circleci/config/jobs/push_operator_to_community_operators.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@ steps:
7070
name: Notify Slack on failure
7171
command: |
7272
if [[ "${NOTHING_TO_TEST}" != "true" ]]; then
73-
./scripts/slack/notify_failure.py "push-new-operator on community-operators"
73+
./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
7474
fi
7575
when: on_fail

.circleci/config/jobs/push_operator_to_upstream_community_operators.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@ steps:
7070
name: Notify Slack on failure
7171
command: |
7272
if [[ "${NOTHING_TO_TEST}" != "true" ]]; then
73-
./scripts/slack/notify_failure.py "push-new-operator on upstream-community-operators"
73+
./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
7474
fi
7575
when: on_fail

0 commit comments

Comments
 (0)