Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ddhira123/c702a31028bbeb6ca5d40f5e56a36729 to your computer and use it in GitHub Desktop.
Save ddhira123/c702a31028bbeb6ca5d40f5e56a36729 to your computer and use it in GitHub Desktop.
Solution for Serverless Cloud Run Development: Challenge Lab. Change the ones next to `(change this with yours)`
============TASK 1==========================
T1PUBLICBILL=public-billing-service-593 (change this with yours)
cd
cd ~/pet-theory/lab07/unit-api-billing
gcloud builds submit --tag gcr.io/$PROJECT_ID/billing-staging-api:0.1
gcloud run deploy $T1PUBLICBILL --image gcr.io/$PROJECT_ID/billing-staging-api:0.1
gcloud run services list
============== TASK 2 =======================
T2FRONTENDSTAGINGSERVICE=frontend-staging-service-792 (change this with yours)
cd
cd ~/pet-theory/lab07/staging-frontend-billing
gcloud builds submit --tag gcr.io/${PROJECT_ID}/frontend-staging:0.1
gcloud run deploy $T2FRONTENDSTAGINGSERVICE --image gcr.io/${PROJECT_ID}/frontend-staging:0.1
gcloud run services list
============TASK 3==========================
T3PRIVATEBILL=private-billing-service-920 (change this with yours)
cd
cd ~/pet-theory/lab07/staging-api-billing
gcloud builds submit --tag gcr.io/${PROJECT_ID}/billing-staging-api:0.2
gcloud run deploy $T3PRIVATEBILL --image gcr.io/${PROJECT_ID}/billing-staging-api:0.2 --no-allow-unauthenticated
gcloud run services list
BILLING_URL=$(gcloud run services describe private-billing-service-920 \
--platform managed \
--region us-central1 \
--format "value(status.url)")
curl -X get -H "Authorization: Bearer $(gcloud auth print-identity-token)" $BILLING_URL
============TASK 4==========================
Cloud Console -> Navigation Menu -> IAM -> Service Accounts -> Create -> Insert the Service account name -> CREATE AND CONTINUE -> Continue -> DONE
============TASK 5==========================
T5BILLINGPROD=billing-prod-service-844 (change this with yours)
cd ~/pet-theory/lab07/prod-api-billing
gcloud builds submit --tag gcr.io/$PROJECT_ID/billing-prod-api:0.1
gcloud run deploy $T5BILLINGPROD --image gcr.io/$PROJECT_ID/billing-prod-api:0.1 --no-allow-unauthenticated
export PROD_BILLING_SERVICE=private-billing-service-920
PROD_BILLING_URL=$(gcloud run services \
describe $PROD_BILLING_SERVICE \
--platform managed \
--region us-central1 \
--format "value(status.url)")
curl -X get -H "Authorization: Bearer \
$(gcloud auth print-identity-token)" \
$PROD_BILLING_URL
======================TASK 6 =================
Cloud Console -> Navigation Menu -> IAM -> Service Accounts -> Create -> Insert the Service account name -> CREATE AND CONTINUE -> Pick the permission Cloud Run Invoker -> Continue -> DONE
======================TASK 7 =================
T7FRONTEND=frontend-prod-service-752 (edit this with yours)
cd
cd ~/pet-theory/lab07/prod-frontend-billing
gcloud builds submit --tag gcr.io/${PROJECT_ID}/frontend-prod:0.1
gcloud run deploy $T7FRONTEND --image gcr.io/${PROJECT_ID}/frontend-prod:0.1 --allow-unauthenticated
gcloud run services list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment