2014-12-17 23:00:26 +03:00
|
|
|
# playground
|
|
|
|
|
|
|
|
This subrepository holds the source for various packages and tools that support
|
|
|
|
the Go playground: https://play.golang.org/
|
|
|
|
|
2016-08-16 01:36:00 +03:00
|
|
|
To submit changes to this repository, see http://golang.org/doc/contribute.html.
|
|
|
|
|
2017-12-19 20:43:27 +03:00
|
|
|
## Frontend
|
|
|
|
|
|
|
|
### Building
|
|
|
|
|
|
|
|
```
|
|
|
|
# build the frontend image
|
|
|
|
docker build -t frontend frontend/
|
|
|
|
```
|
|
|
|
|
2017-12-19 23:29:51 +03:00
|
|
|
### Dev Setup
|
|
|
|
|
|
|
|
```
|
|
|
|
gcloud components install cloud-datastore-emulator
|
|
|
|
```
|
|
|
|
|
2017-12-19 20:43:27 +03:00
|
|
|
### Running
|
|
|
|
|
|
|
|
```
|
2017-12-19 23:29:51 +03:00
|
|
|
# run the datastore emulator
|
2017-12-20 01:04:24 +03:00
|
|
|
gcloud --project=golang-org beta emulators datastore start
|
2017-12-19 23:29:51 +03:00
|
|
|
# set env vars
|
|
|
|
$(gcloud beta emulators datastore env-init)
|
2017-12-19 20:43:27 +03:00
|
|
|
# run the frontend
|
2017-12-19 23:29:51 +03:00
|
|
|
cd frontend && go install && frontend
|
2017-12-19 20:43:27 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
Now visit localhost:8080 to ensure it worked.
|
|
|
|
|
|
|
|
## Sandbox
|
|
|
|
|
|
|
|
### Building
|
2014-12-17 23:00:26 +03:00
|
|
|
|
|
|
|
```
|
2014-12-23 11:17:26 +03:00
|
|
|
# build the sandbox image
|
2014-12-17 23:00:26 +03:00
|
|
|
docker build -t sandbox sandbox/
|
|
|
|
```
|
|
|
|
|
2017-12-19 20:43:27 +03:00
|
|
|
### Running
|
2014-12-17 23:00:26 +03:00
|
|
|
|
|
|
|
```
|
|
|
|
# run the sandbox
|
|
|
|
docker run -d -p 8080:8080 sandbox
|
|
|
|
# get docker host ip, try boot2docker fallback on localhost.
|
|
|
|
DOCKER_HOST_IP=$(boot2docker ip || echo localhost)
|
|
|
|
# run go some code
|
|
|
|
cat /path/to/code.go | go run ./sandbox/client.go | curl --data @- $DOCKER_HOST_IP:8080/compile
|
|
|
|
```
|
|
|
|
|
|
|
|
To submit changes to this repository, see http://golang.org/doc/contribute.html.
|
2015-01-14 03:39:11 +03:00
|
|
|
|
2016-08-16 01:36:00 +03:00
|
|
|
# Deployment
|
2015-01-14 03:39:11 +03:00
|
|
|
|
2016-08-16 01:36:00 +03:00
|
|
|
(Googlers only) To deploy the front-end, use `play/deploy.sh`.
|
2015-01-14 03:39:11 +03:00
|
|
|
|
|
|
|
```
|
2017-12-19 20:43:27 +03:00
|
|
|
gcloud --project golang-org app deploy sandbox/app-flex.yaml --no-promote
|
2015-01-14 03:39:11 +03:00
|
|
|
```
|
|
|
|
|
2016-08-16 01:36:00 +03:00
|
|
|
Use the Cloud Console's to set the new version as the default:
|
2017-12-19 20:43:27 +03:00
|
|
|
https://cloud.google.com/console/appengine/versions?project=golang-org&moduleId=sandbox-flex
|
2016-08-16 01:36:00 +03:00
|
|
|
Then test that play.golang.org and tour.golang.org are working before deleting
|
|
|
|
the old version.
|