File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
quests/develop-apis-apigee/rest-backend Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ gcloud artifacts repositories create ${REPOSITORY_NAME} --repository-format=dock
2323# build image from code
2424echo " *** submit build of service ${SERVICE_NAME} to Cloud Build ***"
2525gcloud builds submit --tag ${CLOUDRUN_REGION} -docker.pkg.dev/${GOOGLE_PROJECT_ID} /${REPOSITORY_NAME} /${SERVICE_NAME} \
26+ --service-account=${SVCACCT_EMAIL} \
2627 --project=${GOOGLE_PROJECT_ID}
2728
2829# deploy service
Original file line number Diff line number Diff line change 1010export SVCACCT_NAME=" simplebank-rest"
1111export SVCACCT_EMAIL=" ${SVCACCT_NAME} @${GOOGLE_PROJECT_ID} .iam.gserviceaccount.com"
1212export SVCACCT_ROLE=" roles/datastore.user"
13+ export SVCACCT_ROLE2=" cloudbuild.builds.builder"
1314
1415# create service account for Cloud Run service
1516echo " *** creating Cloud Run service account: ${SVCACCT_EMAIL} ***"
@@ -22,3 +23,9 @@ echo "*** adding role ${SVCACCT_ROLE} for Firestore access ***"
2223gcloud projects add-iam-policy-binding ${GOOGLE_PROJECT_ID} \
2324 --member=" serviceAccount:${SVCACCT_EMAIL} " \
2425 --role=${SVCACCT_ROLE}
26+
27+ # add permission to access Cloud Build
28+ echo " *** adding role ${SVCACCT_ROLE} for Firestore access ***"
29+ gcloud projects add-iam-policy-binding ${GOOGLE_PROJECT_ID} \
30+ --member=" serviceAccount:${SVCACCT_EMAIL} " \
31+ --role=${SVCACCT_ROLE2}
You can’t perform that action at this time.
0 commit comments