Google Professional Cloud DevOps Engineer Question 66
Single answerGoogle Cloud PlatformYou are implementing a CI/CD pipeline for a serverless application hosted on Google Cloud Functions. The application is triggered by HTTP requests and uses Cloud Build for deploying updates. The team requires that any deployment to the production environment passes all tests in the staging environment first. How should you design the pipeline to meet this requirement?
- A
Configure Cloud Build to include separate build steps for staging and production, with a manual approval step between them.
- B
Use a single Cloud Build pipeline to deploy directly to production after a successful build and test.
- C
Set up a Cloud Build pipeline that deploys to staging first and then to production automatically once all tests pass.
- D
Use a Cloud Function trigger to deploy to production only after an artifact has been tested in staging.
Show answer and explanation
Correct answer: A
Explanation
To meet the requirement of verifying the application in staging before deploying to production, the CI/CD pipeline should include a manual approval step between the staging and production environments. This ensures that the deployment to production is only performed after all tests in staging are passed and the deployment is explicitly approved. Cloud Build supports manual approval steps, making it an ideal choice for this scenario.
- A. Correct.
This is the correct answer because adding a manual approval step ensures that deployments to production are controlled and only occur after the staging environment has been verified. This approach aligns with best practices for CI/CD pipelines in serverless applications.
- B. Incorrect.
This is incorrect because deploying directly to production without a separate staging environment does not meet the requirement of verifying the application in staging before production deployment.
- C. Incorrect.
This is incorrect because an automatic deployment to production after staging tests may not provide the necessary control and verification required by the team.
- D. Incorrect.
This is incorrect because a Cloud Function trigger is not a standard or reliable approach for managing staged deployments in a CI/CD pipeline.