The packages in this module support Oscar running on the Google Cloud Platform (GCP). It is a separate module to avoid having the main Oscar module, golang.org/x/oscar, depend on GCP.
From the command line:
gcloud --project oscar-go-1 scheduler jobs pause gaby-run-prod --location us-central1
If that fails with a permission error, make sure you have authenticated with
gcloud auth application-default login
The gaby-prod service is deployed automatically on each push to master of the oscar repo via a cloud build trigger deploy-gaby-prod-on-push.
The services gaby-devel and gaby-prod can also be deployed manually following the instructions below.
From the UI:
deploy-gaby-devel
or deploy-gaby-prod
).Or, from the command line:
gcloud builds triggers run [TRIGGER_NAME] --branch master
Here, [TRIGGER_NAME] is one of deploy-gaby-devel
or deploy-gaby-prod
.
Check that the deploy was successful by monitoring the Cloud Build History. (Deploys take around 8 minutes to complete).
Run:
gcloud builds triggers run [TRIGGER_NAME] --sha [COMMIT]
where [TRIGGER_NAME] is one of deploy-gaby-devel
or deploy-gaby-prod
and [COMMIT] is the full commit hash.
Roll back a service from the UI:
Or from the command line:
gcloud run services [SERVICE] update-traffic --to-revisions [REVISION]=100
Here, [SERVICE] is either gaby-prod
or gaby-devel
and revision is the revision name to roll back to, which can be found in the revision history, e.g. gaby-prod-00004-t9p).
Firestore Cloud Run Cloud Build
OSCAR_PROJECT=oscar-go-1
The GitHub API token and the Gemini API key are in the GCP Secret Manager, under hex-encoded names. You shouldn’t need to look at them. Programs that include the internal/gcp/gcpsecret package will be able to access them.
TODO