Using Cloud Build for Building and Testing Application Source Code with External Build Tool - Exam PCD: Professional Cloud Developer

Using External Build Tools in Cloud Build - Exam PCD: Professional Cloud Developer

Question

You are using Cloud Build to build and test application source code stored in Cloud Source Repositories.

The build process requires a build tool not available in the Cloud Build environment.

What should you do?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

B.

When building and testing application source code in Cloud Build, it is possible that the build process may require a build tool that is not available in the default Cloud Build environment. In such cases, there are different approaches that can be taken to resolve the issue, as described below:

A. Download the binary from the internet during the build process. This option involves downloading the missing binary from the internet during the build process. However, this approach may not be feasible if the binary is not freely available or if there are concerns about the reliability or security of the downloaded binary.

B. Build a custom cloud builder image and reference the image in your build steps. This option involves building a custom cloud builder image that includes the required build tool and using it in the build steps. This approach allows for greater control over the build environment and ensures that the required build tool is available during the build process. However, building a custom cloud builder image can be time-consuming and may require knowledge of Docker.

C. Include the binary in your Cloud Source Repositories repository and reference it in your build scripts. This option involves including the missing binary in the Cloud Source Repositories repository and referencing it in the build scripts. This approach ensures that the binary is available during the build process and simplifies the build configuration. However, this approach may not be suitable if the binary is large or changes frequently.

D. Ask to have the binary added to the Cloud Build environment by filing a feature request against the Cloud Build public Issue Tracker. This option involves filing a feature request against the Cloud Build public Issue Tracker to have the missing binary added to the Cloud Build environment. This approach may be suitable if the missing binary is a widely used build tool or if there are concerns about the security or reliability of other options.

In conclusion, the best option depends on the specific requirements and constraints of the project. Option B is often the most reliable and flexible option but may require additional effort to build the custom image. Option C may be suitable for smaller projects or if the binary is stable and not too large. Option D may be suitable if the missing binary is a widely used build tool or if other options are not feasible. Option A may be suitable if the binary is freely available and there are no concerns about reliability or security.