Consider giving this repo a ✨! Thanks!!!
Here's a link to the YouTube video explaining this setup in greater detail:
- You'll need to have gcloud installed.
- Make sure
gcloud
is configured. You can configuregcloud
by runninggcloud init
.
gcloud run deploy greeter
Answer
yes
for all the prompts.
You can test the app by running:
curl https://[APP_URL]/greeting/YourTechBud
First retreive the config of the deployed app by using:
gcloud run services describe greeter --format export > service.yaml
Make any changes in main.go
(like changing the default greeting) then build the application using Google Cloud Build.
gcloud builds submit --tag us-east1-docker.pkg.dev/space-cloud/cloud-run-source-deploy/greeter:0.2.0
In service.yaml
, update the spec.template.spec.containers[0].image
to match the newly deployed image. Also, update the revision name mentioned in spec.template.metadata.name
.
You can test the new version of the app by running:
curl https://[APP_URL]/greeting/YourTechBud
In service.yaml
update the spec.traffic
section to split traffic between the previous and the latest revisions.
traffic:
- revisionName: [PREVIOUS_REVISION_NAME]
percent: 50
- latestRevision: true
percent: 50