1--------
2Overview
3
4This is a Google App Engine server which serves the documentation for Chrome
5apps and extensions. At time of this writing, the primary URL is:
6http://developer.chrome.com/.
7
8
9---------------------
10Developing the Server
11
12You shouldn't need app engine locally to develop the server, preview.py should
13be sufficient. If for some reason you want to test against the app engine SDK:
14
15  1. Download the python Google App Engine SDK from:
16     https://developers.google.com/appengine/downloads
17
18  2. Run './start_dev_server.py <path/to/dev_appserver.py>'
19     (dev_appserver.py is part of the App Engine)
20
21  3. View docs at http://localhost:8080/(apps|extensions)/<doc_name>
22
23
24--------------------------------------------
25Using Google Cloud Storage content providers
26
27With preview.py:
28
29  1. create a directory "[...]/server2/local_debug/gcs/<bucketname>" for every
30     gcs bucket referenced in content_providers.json
31
32  2. copy files to the respective local bucket directories. Preview.py has
33     no access to the real Google Cloud Storage.
34
35With start_dev_server.py:
36
37    1. Install gsutils from https://developers.google.com/storage/docs/gsutil
38
39    2. Set gsutil accordingly to the official instructions.
40
41    3. Make sure you have permission to the GCS buckets specified in
42       content_providers.json by running "gsutil ls gs://bucketname"
43
44    4. Get an oauth token (see instructions at the comment of
45       gcs_file_system_provider.py) and save it to the file
46       "[...]/server2/local_debug/gcs_debug.conf"
47
48Remember that the step 4 needs to be repeated every 10 minutes or so,
49because the oauth access token expires quickly.
50
51--------------------
52Deploying the Server
53
54You will need to have access to the http://chrome-apps-doc.appspot.com app.
55Contact aa@chromium.org, erikkay@chromium.org, miket@chromium.org,
56kalman@chromium.org, or ernestd@chromium.org to obtain access.
57
58Once you have access:
59
601. Increment the version in app.yaml so we can roll back if the update breaks.
61
622. Run build_server.py. This copies some depenencies from /third_party into the
63   server directory so that they get uploaded to App Engine.
64
653. Run appcfg.py (supplied with the App Engine SDK) to upload the server code:
66
67    appcfg.py update .
68
694. When prompted for your credentials, enter the information for the account
70   that has access to the production app.
71
725. Go to http://www.appspot.com, select the docs project, click "versions" in
73   the sidebar, and make the version you just deployed the "default" version.
74
75   If you get an error about too many versions when deploying, go into this
76   view and delete the version which was deployed the longest time ago.  Then
77   try to deploy again.
78