-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
We want to reduce toil and ensure that we’re running the latest Playground version for play.golang.org. The current process involves manual steps, which can be error-prone, forgotten, or interruptive. After this work, changes to Playground or a new Go release should be available on play.golang.org shortly after they’re made.
In either scenario below, we need to ensure that we're always deploying playground built on the latest stable release of Go. It's possible to get this information from maintner.
We have a number of other services that could benefit from CI/CD, but we should focus on solving this issue for playground for the moment, and see what we learn.
Deploying the latest Playground:
It’s possible to configure this flow entirely within Cloud Console and a cloudbuild.yaml
file.
- Grant App Engine access to Cloud Build
- Create a cloudbuild.yaml file in the playground repo
- Add step for gcloud app deploy
- Configure build timeout to avoid currently documented issue
- Create a Cloud Build trigger, and link to github.com/golang/playground
- The user authorizing this trigger needs to be in the golang github org, and an admin of the playground repo on github.
- Convert GO_VERSION in the playground Dockerfile to an ARG with a default value
Our docker build step must populate the latest GO_VERSION when it builds.
There are other options available for pushing directly from gerrit, but would involve additional manual configuration, as well as figuring out where to store it and document it.
Deploying Playground with the latest Go release
This update flow requires determining the latest stable Go release after it happens, then building deploying Playground with the new release. This workflow more involved, as Cloud Build doesn't provide a way to add the business logic that we want out of the box: mainly that we want to trigger based on the latest stable tagged release of a different repository, and not accidentally downgrade (say, if 1.11.x is tagged after 1.12.x)
If either of these workflows feels too difficult to configure, or feels fragile, we should try a gerrit based flow instead.
cloudbuild.yaml
reference: https://cloud.google.com/cloud-build/docs/build-config
App Engine automation quickstart: https://cloud.google.com/source-repositories/docs/quickstart-triggering-builds-with-source-repositories
Cloud Build API for manual (or programmatic) triggers: https://cloud.google.com/cloud-build/docs/running-builds/start-build-manually