How to Setup Slack Integration for Google Cloud Build using Cloud Functions

Learn how to easily setup slack integrations for your GCB CI/CD apps

Google Cloud Build Slack Notification Flow Diagram

The Problem

The Solution

A Little Background

Steps

Prepare GCP Project

Setup Slack App and Webhook

Create and Deploy Cloud Function

gsutil mb gs://[BUCKET_NAME]
>> git clone https://github.com/wayneskillz/GCB-Slack-Notifier 
>> cd GCB-Slack-Notifier
>> ls
const SLACK_WEBHOOK_URL = ''; // Enter Your Slack Webhook URL here

Deploying the Cloud Function

>> gcloud functions deploy subscribe --stage-bucket [BUCKET_NAME] \
--trigger-topic cloud-builds
Sample Google Cloud Build Slack Notification

Google Cloud Architect, Software Engineer & SRE 🕴

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store