From 8fb480af2383f0b4e2fee402ead621c21d493cfd Mon Sep 17 00:00:00 2001 From: Virginia Dooley Date: Thu, 2 May 2024 13:17:46 +0100 Subject: [PATCH] Refactor slack deploy notifications with webhooks --- .circleci/config.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2e78ac484..39ccd8180 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -200,10 +200,6 @@ jobs: command: | . .venv/bin/activate make lambda-migrate - # In the event the deployment has failed, alert the dev team - - slack/notify: - event: fail - template: basic_fail_1 code_deploy: docker: @@ -248,12 +244,14 @@ jobs: DESIRED_CAPACITY=<> \ python deploy/update_auto_scaling_group.py no_output_timeout: 15m # TODO reduce/discuss what is suitable? - # In the event the deployment has failed, alert the dev team - - slack/notify: - event: fail - template: basic_fail_1 - channel: $SLACK_DEFAULT_CHANNEL - + - run: + name: Send failure notification + command: | + if [ "$CIRCLE_JOB" = "code_deploy" ]; then + curl -X POST -H 'Content-type: application/json' --data '{"text":"The job has failed."}' https://hooks.slack.com/services/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 + fi + when: on_fail + workflows: main: