Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud Build integration with Bitbucket

We are using Bitbucket as our version control tool. Builds and deployments are executing on Google Cloud Platform.

All builds are triggered via build triggers as specified in Google Cloud docs. This works great, but we would like to get a build status feedback for specific branch in Bitbucket or preferably on pull request.

I did some research, but I didn't find anything useful on this specific topic. There is a note in Google Cloud docs considering build on pull request which doesn't give us much hope:

"Whether based on branch commits or tag commits, builds are only triggered on pushes to the remote origin. Builds do not trigger on local changes, pre-submits, or pull requests."

GitHub seems to have a very good integration with Google Cloud Build which supports Build status feedback.

Is possible to get Google Cloud Build status feedback in Bitbucket on pull request/remote push and if it is, how? How are you dealing with this problem?

like image 764
Pterygoid Avatar asked Mar 04 '23 09:03

Pterygoid


1 Answers

Here we've made use of, out of the box, integration between Google Cloud Build and Google Pub/Sub. Connected into this default topic cloud_builds we have a Google Cloud Function responsible for making an HTTP request into Bitbucket REST API. This API has a current 2.0 version but several examples still mention the past version 1.0, so be careful about the potential issues.

like image 193
Moacir Rosa Avatar answered Mar 10 '23 09:03

Moacir Rosa