
Answer-first summary for fast verification
Answer: Create a trigger in Cloud Build that activates via a webhook event.
Option A is incorrect because Cloud Build cannot be directly triggered by GitLab in this manner. Option B is incorrect as Pub/Sub messages are not the method for external systems to trigger Cloud Build. Option C is incorrect since manual invocation does not meet the requirement for automation. Option D is correct because Cloud Build can be triggered by external systems, like GitLab, through webhooks. For more details, refer to Google Cloud's documentation on [Cloud Build triggers](https://cloud.google.com/build/docs/triggers) and [automating builds with webhooks](https://cloud.google.com/build/docs/automating-builds/create-webhook-triggers).
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A customer has chosen to use GitLab as their external source code management system and wishes to utilize Cloud Build for Continuous Integration and Deployment to Cloud Run. They aim to automatically initiate a build in Cloud Build whenever code is pushed to GitLab. What is the correct method to achieve this?
A
Set up a trigger in GitLab specifying Cloud Build as the destination.
B
Configure a trigger in Cloud Build to respond to Pub/Sub messages.
C
Establish a trigger in Cloud Build that is manually invoked.
D
Create a trigger in Cloud Build that activates via a webhook event.