Get slack notifications whenever there's a Cloud Build status update.
- Slack App
- Webhook URL for the app above
- Clone this repository
git clone git@github.com:laaraujo/cloud-build-slack-notifications.git
- Change directory to the terraform folder
cd terraform
- Install Terraform providers and dependencies
terraform init
Sample terraform.tfvars
:
project_id = "<gcp_project_id>"
region = "<gcp_region>"
zone = "<gcp_zone>"
slack_app_webhook_url = "<slack_app_webhook_url>"
Config file for the slack notifier image. Let's the actual service know where to look for the template and what kind of notifications to send
- Reference: GCP Cloud Build API
Template for the message received in Slack. This repository includes the default one but it can be customized.
Result notification from Cloud Build
Run Sample Build
option
- Reference: Slack API Block Kit
These instructions assume you already have:
- Terraform installed
- GCP Credentials configured locally
- Check what
terraform plan
looks like:
terraform plan
- If the output above looks good, go ahead and apply those changes (you will be prompted to confirm with "yes"):
terraform apply
- Configuring Slack Notifications
- GCP Cloud Build API for customizing notifier behavior in config.yml
- Slack API Block Kit for customizing slack message in template.json
- Cloud Build Slack Notifier docker image
This project is licensed under the MIT License - see the LICENSE file for details.