From 710e6641bfbde0609eed451e6465ebae9ead4546 Mon Sep 17 00:00:00 2001 From: Martin Hutchinson Date: Wed, 21 Feb 2024 14:50:42 +0000 Subject: [PATCH] Prod notifications in Slack for CloudBuild activity TODO: set up a new channel, a webhook, and register the webhook as a secret. --- deployment/live/cloudbuild/prod/slack.json | 30 +++++++++++++++++++ .../live/cloudbuild/prod/terragrunt.hcl | 5 ++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 deployment/live/cloudbuild/prod/slack.json diff --git a/deployment/live/cloudbuild/prod/slack.json b/deployment/live/cloudbuild/prod/slack.json new file mode 100644 index 0000000..1f9427d --- /dev/null +++ b/deployment/live/cloudbuild/prod/slack.json @@ -0,0 +1,30 @@ +[ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Cloud Build {{.Build.ProjectId}} {{.Build.Id}} {{.Build.Status}}" + } + }, + { + "type": "divider" + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "View Build Logs" + }, + "accessory": { + "type": "button", + "text": { + "type": "plain_text", + "text": "Logs" + }, + "value": "click_me_123", + "url": "{{.Build.LogUrl}}", + "action_id": "button-action" + } + } + ] + diff --git a/deployment/live/cloudbuild/prod/terragrunt.hcl b/deployment/live/cloudbuild/prod/terragrunt.hcl index bb8c32a..ec61cc5 100644 --- a/deployment/live/cloudbuild/prod/terragrunt.hcl +++ b/deployment/live/cloudbuild/prod/terragrunt.hcl @@ -13,8 +13,9 @@ locals { inputs = merge( local.common_vars.locals, { - env = "prod" - cloud_run_service = "distributor-service-ci" + env = "prod" + cloud_run_service = "distributor-service-ci" + slack_template_json = file("slack.json") } )