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:
parent
179a58e865
commit
e43a8e6daa
3
Documentation/.gitignore
vendored
3
Documentation/.gitignore
vendored
@ -1,3 +1,2 @@
|
||||
*.html
|
||||
/release-gae
|
||||
/config.mak
|
||||
/.published
|
||||
|
@ -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))
|
||||
ASCIIDOC = asciidoc
|
||||
ASCIIDOC_EXTRA =
|
||||
PYSDK = python2.5
|
||||
APPCFG = $(PYSDK) $(SDK)/appcfg.py $(APPCFG_OPTS) -e '$(ADMIN)'
|
||||
R_WEB = release-gae
|
||||
APPID = gerrit-documentation
|
||||
SVN = svn
|
||||
PUB_ROOT = https://gerrit.googlecode.com/svn/documentation
|
||||
LOCAL_ROOT = .published
|
||||
|
||||
-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
|
||||
|
||||
html: $(DOC_HTML)
|
||||
|
||||
update: html
|
||||
@rm -rf $(R_WEB)
|
||||
@mkdir -p $(R_WEB)/Documentation
|
||||
cp app.yaml redirect.py $(R_WEB)
|
||||
cp ../appjar/src/main/java/com/google/gerrit/public/favicon.ico $(R_WEB)
|
||||
cp *.html $(R_WEB)/Documentation
|
||||
git describe HEAD >$(R_WEB)/application_version
|
||||
perl -pi -e 's/(application:).*/$$1 $(APPID)/' $(R_WEB)/app.yaml
|
||||
$(APPCFG) update $(R_WEB)
|
||||
-rm -rf $(LOCAL_ROOT)
|
||||
$(SVN) checkout $(PUB_DIR) $(LOCAL_ROOT)
|
||||
rm -f $(LOCAL_ROOT)/*.html
|
||||
cp *.html $(LOCAL_ROOT)
|
||||
cd $(LOCAL_ROOT) && \
|
||||
r=`$(SVN) status | perl -ne 'print if s/^! *//' ` && \
|
||||
if [ -n "$$r" ]; then $(SVN) rm $$r; fi && \
|
||||
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:
|
||||
rm -f *.html $(R_WEB)
|
||||
rm -f *.html
|
||||
rm -rf $(LOCAL_ROOT)
|
||||
|
||||
$(DOC_HTML): %.html : %.txt
|
||||
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()
|
Loading…
Reference in New Issue
Block a user