Skip to content
[mirror] The Go Playground
Go Dockerfile HTML HCL Makefile CSS JavaScript
Branch: master
Clone or download
Pull request Compare This branch is 16 commits ahead, 3 commits behind golang:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd/latestgo
deploy
sandbox
static
.gitignore
AUTHORS
CONTRIBUTING.md
CONTRIBUTORS
Dockerfile
LICENSE
Makefile
PATENTS
README.md
app.yaml
cache.go
client.go
codereview.cfg
edit.go
edit.html
enable-fake-time.patch
fake_fs.lst
fmt.go
fmt_test.go
go.mod
go.sum
logger.go
main.go
play.go
play_test.go
sandbox.go
server.go
server_test.go
share.go
store.go
tests.go
txtar.go
txtar_test.go
vet.go

README.md

playground

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

Building

# build the image
git clone git@github.com:yeyuqiu/playground.git
cd playground
docker build -t playground .

Running

docker run --name=play --rm -p 8080:8080 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:latest gcr.io/golang-org/playground:latest
docker push gcr.io/golang-org/playground:latest
gcloud --project=golang-org --account=you@google.com app deploy app.yaml --image-url=gcr.io/golang-org/playground: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.

You can’t perform that action at this time.