Move documentation to gerrit.googlecode.com website
This makes it easier to store multiple editions of the documentation for Gerrit 2.0, 2.1, and so on. Google AppEngine has a 1,000 file limit, so storing more than a few editions online would be difficult. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
3
Documentation/.gitignore
vendored
3
Documentation/.gitignore
vendored
@@ -1,3 +1,2 @@
|
|||||||
*.html
|
*.html
|
||||||
/release-gae
|
/.published
|
||||||
/config.mak
|
|
||||||
|
@@ -1,35 +1,40 @@
|
|||||||
ifeq ($(shell uname),Darwin)
|
|
||||||
SDK = /usr/local/bin
|
|
||||||
else
|
|
||||||
SDK = $(HOME)/google_appengine
|
|
||||||
endif
|
|
||||||
|
|
||||||
DOC_HTML = $(patsubst %.txt,%.html,$(wildcard *.txt))
|
DOC_HTML = $(patsubst %.txt,%.html,$(wildcard *.txt))
|
||||||
ASCIIDOC = asciidoc
|
ASCIIDOC = asciidoc
|
||||||
ASCIIDOC_EXTRA =
|
ASCIIDOC_EXTRA =
|
||||||
PYSDK = python2.5
|
SVN = svn
|
||||||
APPCFG = $(PYSDK) $(SDK)/appcfg.py $(APPCFG_OPTS) -e '$(ADMIN)'
|
PUB_ROOT = https://gerrit.googlecode.com/svn/documentation
|
||||||
R_WEB = release-gae
|
LOCAL_ROOT = .published
|
||||||
APPID = gerrit-documentation
|
|
||||||
|
|
||||||
-include config.mak
|
DOC_VERS := $(shell git describe HEAD)
|
||||||
|
DOC_VMM := $(shell sh -c "echo $(DOC_VERS) | perl -pe 's,^v(\d+\.\d+)[\.-].*\$$,\$$1,'")
|
||||||
|
PUB_DIR = $(PUB_ROOT)/$(DOC_VMM)
|
||||||
|
|
||||||
all: html
|
all: html
|
||||||
|
|
||||||
html: $(DOC_HTML)
|
html: $(DOC_HTML)
|
||||||
|
|
||||||
update: html
|
update: html
|
||||||
@rm -rf $(R_WEB)
|
-rm -rf $(LOCAL_ROOT)
|
||||||
@mkdir -p $(R_WEB)/Documentation
|
$(SVN) checkout $(PUB_DIR) $(LOCAL_ROOT)
|
||||||
cp app.yaml redirect.py $(R_WEB)
|
rm -f $(LOCAL_ROOT)/*.html
|
||||||
cp ../appjar/src/main/java/com/google/gerrit/public/favicon.ico $(R_WEB)
|
cp *.html $(LOCAL_ROOT)
|
||||||
cp *.html $(R_WEB)/Documentation
|
cd $(LOCAL_ROOT) && \
|
||||||
git describe HEAD >$(R_WEB)/application_version
|
r=`$(SVN) status | perl -ne 'print if s/^! *//' ` && \
|
||||||
perl -pi -e 's/(application:).*/$$1 $(APPID)/' $(R_WEB)/app.yaml
|
if [ -n "$$r" ]; then $(SVN) rm $$r; fi && \
|
||||||
$(APPCFG) update $(R_WEB)
|
a=`$(SVN) status | perl -ne 'print if s/^\? *//' ` && \
|
||||||
|
if [ -n "$$a" ]; then \
|
||||||
|
$(SVN) add $$r && \
|
||||||
|
$(SVN) propset svn:mime-type text/html $$r ; \
|
||||||
|
fi && \
|
||||||
|
$(SVN) commit -m "Updated documentation $(DOC_VMM) to $(DOC_VERS)"
|
||||||
|
-rm -rf $(LOCAL_ROOT)
|
||||||
|
|
||||||
|
new-docs:
|
||||||
|
$(SVN) mkdir -m "Create documentation $(DOC_VMM)" $(PUB_DIR)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.html $(R_WEB)
|
rm -f *.html
|
||||||
|
rm -rf $(LOCAL_ROOT)
|
||||||
|
|
||||||
$(DOC_HTML): %.html : %.txt
|
$(DOC_HTML): %.html : %.txt
|
||||||
rm -f $@+ $@
|
rm -f $@+ $@
|
||||||
|
@@ -1,22 +0,0 @@
|
|||||||
application: gerrit-documentation
|
|
||||||
version: 1
|
|
||||||
runtime: python
|
|
||||||
api_version: 1
|
|
||||||
|
|
||||||
default_expiration: 5m
|
|
||||||
|
|
||||||
handlers:
|
|
||||||
- url: /application_version
|
|
||||||
mime_type: text/plain
|
|
||||||
static_files: application_version
|
|
||||||
upload: application_version
|
|
||||||
|
|
||||||
- url: /favicon.ico
|
|
||||||
static_files: favicon.ico
|
|
||||||
upload: favicon.ico
|
|
||||||
|
|
||||||
- url: /Documentation
|
|
||||||
static_dir: Documentation
|
|
||||||
|
|
||||||
- url: .*
|
|
||||||
script: redirect.py
|
|
@@ -1,21 +0,0 @@
|
|||||||
# Simple redirect for / to Documentation/index.html
|
|
||||||
|
|
||||||
from google.appengine.ext import webapp
|
|
||||||
from google.appengine.ext.webapp.util import run_wsgi_app
|
|
||||||
|
|
||||||
def _CreateApplication():
|
|
||||||
return webapp.WSGIApplication([
|
|
||||||
(r'^/$', RedirectDocumentation),
|
|
||||||
],
|
|
||||||
debug=False)
|
|
||||||
|
|
||||||
class RedirectDocumentation(webapp.RequestHandler):
|
|
||||||
def get(self):
|
|
||||||
self.redirect('Documentation/index.html', permanent=True)
|
|
||||||
|
|
||||||
def main():
|
|
||||||
run_wsgi_app(application)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
application = _CreateApplication()
|
|
||||||
main()
|
|
Reference in New Issue
Block a user