Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Is it possible to receive notifications for each step in the Cloud Build?

I have followed the URL below to receive Slack notifications of Cloud Build changes.
 
I currently receive notifications for each Cloud Build status change, but is it possible to receive notifications for each step in the Cloud Build?
0 5 1,053
5 REPLIES 5

Hi @YoshinaoMori,

Welcome to the Google Cloud Community!

Yes, It is possible to receive notifications when your Cloud Build's state changes. It could be when your build is created, when it transitions to a working state, and when it completes. You can subscribe to a Google Pub/Sub Topic to view the notifications that are published by Cloud Build. 

This documentation should be able to help you in Subscribing to Build Notifications. 

Let me know if it helped, thanks

Hi @Marramirez 

Thanks for the quick response!

I'm sorry. What I want to achieve is the following.


I have defined 3 steps in cloudbuild.yaml.
- step1. build docker image
- step2. push docker image
- step3. call Cloud Functions

We want to receive start and end notifications for each of these steps. Is it possible?

Hi @YoshinaoMori,

Yes, It's possible. When you run builds, Cloud Builds can Store and Manage Build Logs 

You can store the build logs through:

  • Google-created bucket
  • User-created bucket
  • User-owned and regionalized bucket

Let me know if it helped, thanks!

Hi @Marramirez 

Thanks for the quick response!

Sorry, we would like to check if each Cloud Build process is going well by receiving Slack notifications instead of keeping an eye on the Google Cloud console. Am I right in thinking that this is not the way to receive Slack notifications?

Specifically, I would like to receive the following notifications via Slack.

  • start, success and failure of docker build
  • start, success and failure of docker push
  • start, success and failure of cloud functions call

I can currently see the build log from the Google Cloud Console.

I ahev not tried this yet, but maybe, you can use "curl" comamnd between each of your step to "post" your status/logs between each step of the Build?