Find file History
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.
.gitignore
Dockerfile.prod cmd/godoc: add missing Dockerfile ARG Oct 10, 2018
Makefile cmd/godoc: add cloud build config Oct 4, 2018
README.godoc-app cmd/godoc: add cloud build config Oct 4, 2018
app.dev.yaml cmd/godoc: simplify dev and prod environment for App Engine Sep 28, 2018
app.prod.yaml cmd/godoc: re-enable host checking, allow test versions Oct 3, 2018
appinit.go cmd/godoc: start RunIndexer synchronously when index is present Nov 12, 2018
autocert.go
blog.go cmd/godoc: redirect to https instead of http for blog.golang.org Aug 22, 2018
cloudbuild.yaml cmd/godoc: add cloud build config Oct 4, 2018
codewalk.go go.tools: use golang.org/x/... import paths Nov 9, 2014
dl.go godoc: migrate to App Engine flexible Oct 2, 2018
doc.go cmd/godoc: cleanup documentation for CLI mode Oct 18, 2018
generate-index.bash godoc: migrate to App Engine flexible Oct 2, 2018
godoc_test.go godoc, cmd/godoc: remove CLI support Oct 11, 2018
goroot.go cmd/godoc: use same GOROOT discovery as Go 1.10's cmd/go Jun 12, 2018
handlers.go godoc, cmd/godoc: remove CLI support Oct 11, 2018
hg-git-mapping.bin godoc: migrate to App Engine flexible Oct 2, 2018
index.go cmd/godoc: exclude /pkg from search indexing Mar 12, 2015
main.go godoc: choose a smaller-output example as help when there are unexpec… Dec 20, 2018
play.go godoc: migrate to App Engine flexible Oct 2, 2018
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)