[dev.go2go] add go2goplay Cloud Build deploy trigger

This config will cause Cloud Build to deploy go2goplay.golang.org
when a commit is made to the dev.go2go branch of the main go repo.

Change-Id: I5e1639cdb30b6c24d1578de47d960d530cdd2102
Reviewed-on: https://go-review.googlesource.com/c/playground/+/257217
Trust: Andrew Bonventre <andybons@golang.org>
Trust: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2 files changed
tree: 040e4b41d21d610f3622da3cea898f00f5e395f1
  1. cmd/
  2. deploy/
  3. examples/
  4. internal/
  5. sandbox/
  6. static/
  7. .gitignore
  8. AUTHORS
  9. CONTRIBUTING.md
  10. CONTRIBUTORS
  11. Dockerfile
  12. LICENSE
  13. Makefile
  14. PATENTS
  15. README.md
  16. app.yaml
  17. cache.go
  18. client.go
  19. codereview.cfg
  20. edit.go
  21. edit.html
  22. enable-fake-time.patch
  23. fake_fs.lst
  24. fmt.go
  25. fmt_test.go
  26. go.mod
  27. go.sum
  28. logger.go
  29. main.go
  30. play.go
  31. play_test.go
  32. sandbox.go
  33. sandbox_test.go
  34. server.go
  35. server_test.go
  36. share.go
  37. store.go
  38. tests.go
  39. txtar.go
  40. txtar_test.go
  41. vet.go
README.md

playground

This subrepository holds the source for the Go playground: https://play.golang.org/

Building

# build the image
docker build -t playground .

Running

docker run --name=play --rm -p 8080:8080 golang/playground &
# run some Go code
cat /path/to/code.go | go run client.go | curl -s --upload-file - localhost:8080/compile

Deployment

Deployment Triggers

Playground releases automatically triggered when new Go repository tags are pushed to GitHub, or when master is pushed on the playground repository.

For details, see deploy/go_trigger.json, deploy/playground_trigger.json, and deploy/deploy.json.

After making changes to trigger configuration, update configuration by running the following Make target:

make update-cloudbuild-trigger

Deploy via Cloud Build

The Cloud Build configuration will always build and deploy with the latest supported release of Go.

gcloud builds submit --config deploy/deploy.json .

Deploy via gcloud app deploy

Building the playground Docker container takes more than the default 10 minute time limit of cloud build, so increase its timeout first (note, app/cloud_build_timeout is a global configuration value):

gcloud config set app/cloud_build_timeout 1200  # 20 mins

Alternatively, to avoid Cloud Build and build locally:

make docker
docker tag golang/playground-go2go:latest gcr.io/golang-org/playground-go2go:latest
docker push gcr.io/golang-org/playground-go2go:latest
gcloud --project=golang-org --account=you@google.com app deploy app.yaml --image-url=gcr.io/golang-org/playground-go2go:latest

Then:

gcloud --project=golang-org --account=you@google.com app deploy app.yaml

Contributing

To submit changes to this repository, see https://golang.org/doc/contribute.html.