Skip to content

laaraujo/cloud-build-slack-notifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tfsec

Cloud Build Slack notifications

Get slack notifications whenever there's a Cloud Build status update.

Table of contents

Pre-requisites

  1. Slack App
  2. Webhook URL for the app above

Installation

  1. Clone this repository
git clone git@github.com:laaraujo/cloud-build-slack-notifications.git
  1. Change directory to the terraform folder
cd terraform
  1. Install Terraform providers and dependencies
terraform init

Configuration

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

Template for the message received in Slack. This repository includes the default one but it can be customized.

resulting notifications Result notification from Cloud Build Run Sample Build option

Manual deployment

These instructions assume you already have:

  1. Check the what the terraform plan looks like:
terraform plan
  1. If the output above looks good, go ahead and apply those changes (you will be prompted to confirm with "yes"):
terraform apply

Sources

License

This project is licensed under the MIT License - see the LICENSE file for details.