Skip to content
[mirror] The Go Playground
Go HTML Dockerfile Makefile CSS HCL JavaScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd/latestgo playground: simplify latest go version logic Jul 11, 2019
deploy playground: simplify latest go version logic Jul 11, 2019
examples playground: add examples to demonstrate tricks Mar 14, 2020
internal sandbox: instrument number of running containers Apr 24, 2020
sandbox sandbox: fix missing timezone data Apr 30, 2020
static playground: use flexbox for navbar layout Apr 27, 2020
.gitignore sandbox: add gvisor runsc-based sandbox Jan 8, 2020
AUTHORS initial commit Dec 9, 2014
CONTRIBUTING.md CONTRIBUTING.md: remove note about not accepting Pull Requests Mar 14, 2018
CONTRIBUTORS initial commit Dec 9, 2014
Dockerfile playground: isolate playground build stage in Docker Apr 15, 2020
LICENSE initial commit Dec 9, 2014
Makefile sandbox: timeout runsc commands Apr 15, 2020
PATENTS initial commit Dec 9, 2014
README.md playground: bound compilation time too Sep 13, 2019
app.yaml playground: run in golang VPC network Jan 9, 2020
cache.go playground: stop storing timeouts in cache Apr 23, 2020
client.go Merge sandbox and frontend into one service Dec 24, 2017
codereview.cfg playground: add codereview.cfg Mar 18, 2015
edit.go playground: enable CORS on /fmt and /p/ routes Mar 25, 2020
edit.html playground: use flexbox for navbar layout Apr 27, 2020
enable-fake-time.patch Merge sandbox and frontend into one service Dec 24, 2017
fake_fs.lst Merge sandbox and frontend into one service Dec 24, 2017
fmt.go playground: enable CORS on /fmt and /p/ routes Mar 25, 2020
fmt_test.go playground: enable CORS on /fmt and /p/ routes Mar 25, 2020
go.mod sandbox: instrument HTTP handlers with StackDriver Apr 24, 2020
go.sum sandbox: instrument HTTP handlers with StackDriver Apr 24, 2020
logger.go Merge sandbox and frontend into one service Dec 24, 2017
main.go playground: stop storing timeouts in cache Apr 23, 2020
play.go playground: interleave standard output and error correctly Apr 13, 2018
play_test.go playground: interleave standard output and error correctly Apr 13, 2018
sandbox.go playground: only build binaries for health check Apr 23, 2020
sandbox_test.go playground: make isTest match its documentation Apr 18, 2020
server.go
server_test.go playground: stop storing timeouts in cache Apr 23, 2020
share.go playground: loosen restrictions on IPs permitted to share Jan 5, 2018
store.go Merge sandbox and frontend into one service Dec 24, 2017
tests.go sandbox: fix missing timezone data Apr 30, 2020
txtar.go playground: use txtar and modfile from golang.org/x Nov 20, 2019
txtar_test.go playground: format go.mod files; fix paths in formatting errors May 15, 2019
vet.go sandbox: add gvisor runsc-based sandbox Jan 8, 2020

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: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.