mirror of https://github.com/golang/go.git
Add a redirect for the recently created x/website subrepository. It's not yet included at https://golang.org/pkg/#subrepo because it's in development. Once development reaches the point that x/website is the canonical location of the golang.org server, we can consider including x/website at https://golang.org/pkg/#subrepo (just like x/blog, x/tour, x/build are already included there). Updates golang/go#29206 Change-Id: I6889c1f5e40f11abca944b217a7354f76c08c8eb Reviewed-on: https://go-review.googlesource.com/c/156337 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| Dockerfile.prod | ||
| Makefile | ||
| README.godoc-app | ||
| app.dev.yaml | ||
| app.prod.yaml | ||
| appinit.go | ||
| autocert.go | ||
| blog.go | ||
| cloudbuild.yaml | ||
| codewalk.go | ||
| dl.go | ||
| doc.go | ||
| generate-index.bash | ||
| godoc_test.go | ||
| goroot.go | ||
| handlers.go | ||
| hg-git-mapping.bin | ||
| index.go | ||
| main.go | ||
| play.go | ||
| regtest_test.go | ||
| x.go | ||
README.godoc-app
godoc on Google App Engine
==========================
Prerequisites
-------------
* Google Cloud SDK
https://cloud.google.com/sdk/
* Redis
* Go sources under $GOROOT
* Godoc sources inside $GOPATH
(go get -d golang.org/x/tools/cmd/godoc)
Running locally, in production mode
-----------------------------------
Build the app:
go build -tags golangorg
Run the app:
./godoc
godoc should come up at http://localhost:8080
Use the PORT environment variable to change the port:
PORT=8081 ./godoc
Running locally, in production mode, using Docker
-------------------------------------------------
Build the app's Docker container:
make docker-build
Make sure redis is running on port 6379:
$ echo PING | nc localhost 6379
+PONG
^C
Run the datastore emulator:
gcloud beta emulators datastore start --project golang-org
In another terminal window, run the container:
$(gcloud beta emulators datastore env-init)
docker run --rm \
--net host \
--env GODOC_REDIS_ADDR=localhost:6379 \
--env DATASTORE_EMULATOR_HOST=$DATASTORE_EMULATOR_HOST \
--env DATASTORE_PROJECT_ID=$DATASTORE_PROJECT_ID \
gcr.io/golang-org/godoc
godoc should come up at http://localhost:8080
Deploying to golang.org
-----------------------
Make sure you're signed in to gcloud:
gcloud auth login
Build the image, push it to gcr.io, and deploy to Flex:
make cloud-build deploy
Point the load balancer to the newly deployed version:
(This also runs regression tests)
make publish
Stop and/or delete down any very old versions. (Stopped versions can be re-started.)
Keep at least one older verson to roll back to, just in case.
You can also migrate traffic to the new version via this UI.
https://console.cloud.google.com/appengine/versions?project=golang-org&serviceId=default&versionssize=50
Troubleshooting
---------------
Ensure the Cloud SDK is on your PATH and you have the app-engine-go component
installed (gcloud components install app-engine-go) and your components are
up-to-date (gcloud components update)