2014-12-17 23:00:26 +03:00
# playground
2017-12-24 02:02:41 +03:00
This subrepository holds the source for the Go playground:
https://play.golang.org/
2014-12-17 23:00:26 +03:00
2017-12-24 02:02:41 +03:00
## Building
2017-12-19 20:43:27 +03:00
2017-12-20 03:30:25 +03:00
```
2017-12-24 02:02:41 +03:00
# build the image
docker build -t playground .
2017-12-20 03:30:25 +03:00
```
2017-12-24 02:02:41 +03:00
## Running
2014-12-17 23:00:26 +03:00
```
2018-04-11 08:01:01 +03:00
docker run --name=play --rm -d -p 8080:8080 playground
# run some Go code
cat /path/to/code.go | go run client.go | curl -s --upload-file - localhost:8080/compile
2014-12-17 23:00:26 +03:00
```
2016-08-16 01:36:00 +03:00
# Deployment
2015-01-14 03:39:11 +03:00
2019-02-28 21:47:27 +03:00
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
```
2019-05-10 21:19:28 +03:00
Alternatively, to avoid Cloud Build and build locally:
```
make docker
docker tag 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
```
2019-02-28 21:47:27 +03:00
Then:
2017-12-21 01:35:14 +03:00
```
2019-05-10 21:19:28 +03:00
gcloud --project=golang-org --account=you@google.com app deploy app.yaml
2017-12-21 01:35:14 +03:00
```
2015-01-14 03:39:11 +03:00
2017-12-24 02:02:41 +03:00
# Contributing
2015-01-14 03:39:11 +03:00
2018-04-11 08:01:01 +03:00
To submit changes to this repository, see
https://golang.org/doc/contribute.html.