Google Professional Cloud DevOps Engineer Question 212
Select 3Google Cloud PlatformYour team is deploying a serverless application using Google Cloud Functions. You want to set up a CI/CD pipeline to automate the deployment process. The team has the following requirements:
- Ensure code quality by running tests before deployment.
- Deploy only to specific environments (e.g., staging or production) based on branch names.
- Use Google Cloud-native tools for seamless integration.
Which combination of tools and configurations should you use to meet these requirements?
- A
Use Cloud Build to define a build trigger that runs tests and deploys code when changes are pushed to a specific branch.
- B
Use Deployment Manager to deploy the serverless application to staging and production environments.
- C
Configure Cloud Build with separate build steps to run tests, build artifacts, and deploy the application using the gcloud CLI.
- D
Use a third-party CI/CD tool, such as Jenkins, to manage the pipeline for Google Cloud Functions.
- E
Define different build triggers in Cloud Build for staging and production, each tied to its respective branch.
Show answer and explanation
Correct answers: A, C, E
Explanation
To automate the CI/CD pipeline for serverless applications using Google Cloud-native tools, Cloud Build is the appropriate choice. Defining build triggers automates the pipeline based on branch changes, and configuring separate steps ensures automated testing, artifact creation, and deployment. Using separate build triggers for environments further aligns with the requirement to deploy to specific environments.
- A. Correct.
Correct. Cloud Build is a Google Cloud-native CI/CD tool that integrates seamlessly with serverless applications. Defining a build trigger ensures automation of the pipeline when changes are pushed to a branch.
- B. Incorrect.
Incorrect. Deployment Manager is primarily used for managing infrastructure as code, not for deploying serverless applications like Cloud Functions.
- C. Correct.
Correct. Configuring Cloud Build with multiple steps allows you to run tests, build artifacts, and deploy using the gcloud CLI, meeting the requirement for code quality checks and deployment.
- D. Incorrect.
Incorrect. While Jenkins is a popular CI/CD tool, the team specifically wants to use Google Cloud-native tools for seamless integration.
- E. Correct.
Correct. Defining separate build triggers for staging and production tied to respective branches ensures deployments are environment-specific, aligning with the requirement.