1
0
mirror of https://github.com/golang/go synced 2024-11-18 10:14:45 -07:00
go/cmd/godoc
Chris Broadfoot e9ca907325 cmd/godoc: simplify dev and prod environment for App Engine
Remove all of the code generation and the concept of "APPDIR" - just
generate godoc.zip and index files in the app directory.

Simplify generation of the zip - use a symlink so that every file in
godoc.zip is under the "goroot" directory, regardless of the
environment. Previously, the prefix would be dependent on the location
of the user's GOROOT.

Running the setup script is now optional - it's now possible to run
dev_appserver.py on a regular checkout of cmd/godoc without godoc.zip
and search index files. Use environment variables to switch whether the
zip file is used vs reading GOROOT from the filesystem.

Change-Id: I1ce95c891717fe2da975f979778fd775b23f18c8
Reviewed-on: https://go-review.googlesource.com/46725
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-09-28 11:54:07 +00:00
..
.gitignore cmd/godoc: simplify dev and prod environment for App Engine 2018-09-28 11:54:07 +00:00
app.dev.yaml cmd/godoc: simplify dev and prod environment for App Engine 2018-09-28 11:54:07 +00:00
app.prod.yaml cmd/godoc: simplify dev and prod environment for App Engine 2018-09-28 11:54:07 +00:00
appinit.go cmd/godoc: simplify dev and prod environment for App Engine 2018-09-28 11:54:07 +00:00
autocert.go cmd/godoc: support http-01 ACME challenge in optional autocert support 2018-04-11 21:25:11 +00:00
blog.go cmd/godoc: redirect to https instead of http for blog.golang.org 2018-08-22 02:22:54 +00:00
codewalk.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
dl.go godoc/{dl,proxy,short}: move packages out of Google's internal repo 2015-09-23 03:53:05 +00:00
doc.go cmd/godoc: Fix package comment inconsistencies. 2017-03-04 00:53:44 +00:00
generate-index.bash cmd/godoc: simplify dev and prod environment for App Engine 2018-09-28 11:54:07 +00:00
godoc_test.go cmd/godoc: remove workaround for 1.8 behavior 2018-08-28 01:58:42 +00:00
goroot.go cmd/godoc: use same GOROOT discovery as Go 1.10's cmd/go 2018-06-12 01:24:34 +00:00
handlers.go cmd/godoc,cmd/tip: enable HSTS preload 2018-07-06 16:21:24 +00:00
index.go cmd/godoc: exclude /pkg from search indexing 2015-03-12 00:26:38 +00:00
main.go godoc: update to use new goroot finding logic 2018-08-23 15:26:32 +00:00
play.go cmd/godoc: always serve fmt handler, HTTPS fix redirection 2015-09-25 02:10:07 +00:00
README.godoc-app cmd/godoc: simplify dev and prod environment for App Engine 2018-09-28 11:54:07 +00:00
remotesearch.go
x.go godoc/static: add perf, review, sync subrepos 2018-03-30 16:45:20 +00:00

godoc on Google App Engine
==========================

Prerequisites
-------------

* Google Cloud SDK
  https://cloud.google.com/sdk/

* Go sources under $GOROOT

* Godoc sources inside $GOPATH
  (go get -d golang.org/x/tools/cmd/godoc)


Running in dev_appserver.py
---------------------------

Use dev_appserver.py to run the server in development mode:

	dev_appserver.py app.dev.yaml

To run the server with generated zip file and search index:

	./generate-index.bash
	dev_appserver.py app.prod.yaml

godoc should come up at http://localhost:8080
Use the --host and --port flags to listen on a different address.

To clean up the index files, use git:

	git clean -xn # n is dry run, replace with f


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)