PROFESSIONAL-CLOUD-DEVELOPER · Question #117
Your development team is using Cloud Build to promote a Node.js application built on App Engine from your staging environment to production. The application relies on several directories of photos sto
The correct answer is C. Add a build step in the cloudbuild.yaml file before the promotion step with the arguments:. Adding a build step to cloudbuild.yaml integrates the photo copy directly into the CI/CD pipeline, automating it as part of every promotion. Choice C uses gsutil (the Cloud Storage CLI) as a Cloud Build step - specifically with rsync or cp arguments - to copy the photos from webp
Question
Your development team is using Cloud Build to promote a Node.js application built on App Engine from your staging environment to production. The application relies on several directories of photos stored in a Cloud Storage bucket named webphotos-staging in the staging environment. After the promotion, these photos must be available in a Cloud Storage bucket named webphotos-prod in the production environment. You want to automate the process where possible. What should you do?
Options
- AManually copy the photos to webphotos-prod.
- BAdd a startup script in the application's app.yami file to move the photos from webphotos-staging
- CAdd a build step in the cloudbuild.yaml file before the promotion step with the arguments:
- DAdd a build step in the cloudbuild.yaml file before the promotion step with the arguments:
How the community answered
(24 responses)- A4% (1)
- B8% (2)
- C71% (17)
- D17% (4)
Explanation
Adding a build step to cloudbuild.yaml integrates the photo copy directly into the CI/CD pipeline, automating it as part of every promotion. Choice C uses gsutil (the Cloud Storage CLI) as a Cloud Build step - specifically with rsync or cp arguments - to copy the photos from webphotos-staging to webphotos-prod before the App Engine promotion step. This ensures the photos are always in sync before the new app version goes live. Choice A (manual copy) is not automated. Choice B (startup script in app.yaml) runs when the app starts, not during the build/promotion phase, and is not designed for data migration. Choice D likely uses incorrect or less appropriate arguments than Choice C (e.g., wrong flags or command structure for this use case).
Topics
Community Discussion
No community discussion yet for this question.