
Explanation:
The correct approach involves automating the copying of photos from the staging bucket to the production bucket as part of the Cloud Build process. This ensures efficiency and reliability. Option D is the correct choice as it suggests adding a build step in the cloudbuild.yaml file with the necessary arguments to use gsutil for copying the files, which is the recommended method for automating such tasks within Google Cloud Platform's ecosystem.
Ultimate access to all questions.
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?
A
Manually copy the photos to webphotos-prod.
B
Add a startup script in the application's app.yami file to move the photos from webphotos-staging to webphotos-prod.
C
Add a build step in the cloudbuild.yaml file before the promotion step with the arguments:
- name: gcr.io/cloud-builders/gsutil
args: ['cp', '-r', 'gs://webphotos-staging', 'gs://webphotos-prod']
waitFor: ['-']
- name: gcr.io/cloud-builders/gsutil
args: ['cp', '-r', 'gs://webphotos-staging', 'gs://webphotos-prod']
waitFor: ['-']
D
Add a build step in the cloudbuild.yaml file before the promotion step with the arguments:
- name: gcr.io/cloud-builders/gcloud
args: ['cp', '-A', 'gs://webphotos-staging', 'gs://webphotos-prod']
waitFor: ['-']
- name: gcr.io/cloud-builders/gcloud
args: ['cp', '-A', 'gs://webphotos-staging', 'gs://webphotos-prod']
waitFor: ['-']