We building a CI/CD based on BitBucket and Google Cloud Build. We have one Cloud Build trigger per project: dev, staging, prod
How can we configure one or 3 webhook that based on the branch will trigger the specific Cloud Build? The only "workaround" we found is to have a Cloud Function which receives BitBucket trigger POST message and based on the JSON "name" field, triggers the specific Cloud Build. Is it the best way to move ahead?
Thanks
EDIT: Cloud Build now supports Bitbucket natively, see https://cloud.google.com/build/docs/release-notes#March_07_2024
There are basically two approaches you can follow with Cloud Build alone, and more if you use a Cloud Function (or other) as an intermediate layer. Sathi Aiswarya pointed to the relevant document in his note.