Continuous Integration and Testing for Cloud Source Repositories | Google PCD Exam

Continuous Integration and Testing for Cloud Source Repositories

Question

Your company stores their source code in a Cloud Source Repositories repository.

Your company wants to build and test their code on each source code commit to the repository and requires a solution that is managed and has minimal operations overhead.

Which method should they use?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

A.

The most appropriate method for building and testing code on each commit to a Cloud Source Repositories repository with minimal operations overhead is option A: Use Cloud Build with a trigger configured for each source code commit.

Cloud Build is a fully-managed, serverless CI/CD platform provided by Google Cloud Platform. It supports a wide range of build environments and languages, and can automatically build, test, and deploy code in response to code changes. Cloud Build integrates seamlessly with Cloud Source Repositories and can be triggered automatically for each commit made to the repository.

Using Cloud Build with a trigger configured for each source code commit ensures that code changes are automatically built and tested on each commit, without requiring any manual intervention. This significantly reduces the operational overhead compared to other solutions that require setting up and managing infrastructure such as virtual machines or continuous integration tools.

Option B, using Jenkins deployed via the Google Cloud Platform Marketplace, is not the best option because it requires manual setup and management of the Jenkins instance, which increases operational overhead. Additionally, Jenkins may not integrate as seamlessly with Cloud Source Repositories as Cloud Build.

Option C, using a Compute Engine virtual machine instance with an open source continuous integration tool, is also not the best option because it requires manual setup and management of the virtual machine, as well as the continuous integration tool. This increases operational overhead and requires more maintenance compared to Cloud Build.

Option D, using a source code commit trigger to push a message to a Cloud Pub/Sub topic that triggers an App Engine service to build the source code, is not the best option because it requires setting up and managing additional infrastructure. This increases operational overhead compared to using Cloud Build directly with Cloud Source Repositories. Additionally, App Engine may not be the best option for building and testing code, as it is primarily designed for deploying and running web applications.