Goolge Cloud Skills Boost

최근글


새댓글


Hot Deal


GSP328 Back Serverless Cloud Run Development: Challenge Lab

컨텐츠 정보

본문

## Provision the Qwiklabs environment ### Set the default project for the environment ``` gcloud config set project \ $(gcloud projects list --format='value(PROJECT_ID)' \ --filter='qwiklabs-gcp') ``` ### Set the region for the run deployments ``` gcloud config set run/region us-central1 ``` ### Set the Cloud Run platform type ``` gcloud config set run/platform managed ``` ### Clone the repo with the Pet Theory code ``` git clone https://github.com/rosera/pet-theory.git && cd pet-theory/lab07 ```

관련자료

댓글 1 / 1 페이지

goorumi님의 댓글

git clone https://github.com/rosera/pet-theory.git && cd pet-theory/lab07

gcloud config set run/region us-central1


export PUBLIC_BILLING_SERVICE=
export FRONTEND_STAGING_SERVICE=
export PRIVATE_BILLING_SERVICE=
export BILLING_SERVICE_ACCOUNT=
export BILLING_PROD_SERVICE=
export FRONTEND_SERVICE_ACCOUNT=
export FRONTEND_PRODUCTION_SERVICE=



Task1
cd ~/pet-theory/lab07/unit-api-billing
gcloud builds submit --tag gcr.io/$DEVSHELL_PROJECT_ID/billing-staging-api:0.1
gcloud run deploy $PUBLIC_BILLING_SERVICE --image gcr.io/$DEVSHELL_PROJECT_ID/billing-staging-api:0.1


Task 2
cd ~/pet-theory/lab07/staging-frontend-billing

gcloud builds submit --tag gcr.io/$DEVSHELL_PROJECT_ID/frontend-staging:0.1
gcloud run deploy $FRONTEND_STAGING_SERVICE --image gcr.io/$DEVSHELL_PROJECT_ID/frontend-staging:0.1


TASK 3
cd ~/pet-theory/lab07/staging-api-billing


gcloud builds submit --tag gcr.io/$DEVSHELL_PROJECT_ID/billing-staging-api:0.2
gcloud run deploy $PRIVATE_BILLING_SERVICE --image gcr.io/$DEVSHELL_PROJECT_ID/billing-staging-api:0.2


BILLING_URL=$(gcloud run services describe $PRIVATE_BILLING_SERVICE 
--platform managed 
--region us-central1 
--format "value(status.url)")

Service should respond when the endpoint is accessed
curl -X get -H "Authorization: Bearer $(gcloud auth print-identity-token)" $BILLING_URL



TASK 4
gcloud iam service-accounts create $BILLING_SERVICE_ACCOUNT --display-name "Billing Service Account Cloud Run"


TASK 5
cd ~/pet-theory/lab07/prod-api-billing
gcloud builds submit --tag gcr.io/$DEVSHELL_PROJECT_ID/billing-prod-api:0.1
gcloud run deploy $BILLING_PROD_SERVICE --image gcr.io/$DEVSHELL_PROJECT_ID/billing-prod-api:0.1


TASK 6
gcloud iam service-accounts create $FRONTEND_SERVICE_ACCOUNT --display-name "Billing Service Account Cloud Run Invoker"


TASK 7
cd ~/pet-theory/lab07/prod-frontend-billing
gcloud builds submit --tag gcr.io/$DEVSHELL_PROJECT_ID/frontend-prod:0.1
gcloud run deploy $FRONTEND_PRODUCTION_SERVICE --image gcr.io/$DEVSHELL_PROJECT_ID/frontend-prod:0.1
전체 20 / 1 페이지
RSS