Skip to content

Commit 761e107

Browse files
author
Ken Gaillot
committed
Doc: all: support uploads of sphinx-generated documentation
1 parent fb12011 commit 761e107

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

doc/sphinx/Makefile.am

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,24 @@ PAPER ?= letter
3232
# Additional options for sphinx-build
3333
SPHINXFLAGS ?=
3434

35+
# toplevel rsync destination for www targets (without trailing slash)
36+
RSYNC_DEST ?= root@www.clusterlabs.org:/var/www/html
37+
3538
# End of useful overrides
3639

3740

3841
EXTRA_DIST = $(wildcard */*.rst)
3942

43+
# recursive, preserve symlinks/permissions/times, verbose, compress,
44+
# don't cross filesystems, sparse, show progress
45+
RSYNC_OPTS = -rlptvzxS --progress
46+
47+
BOOK_RSYNC_DEST = $(RSYNC_DEST)/$(PACKAGE)/doc/$(PACKAGE_SERIES)
48+
49+
TAG ?= $(shell [ -n "`git tag --points-at HEAD | head -1`" ] \
50+
&& ( git tag --points-at HEAD | head -1 ) \
51+
|| git log --pretty=format:Pacemaker-2.0.3-%h -n 1 HEAD)
52+
4053
BOOK = none
4154

4255
if BUILD_SPHINX_DOCS
@@ -70,6 +83,21 @@ $(BOOK)/_build: _static/pacemaker.css $(BOOK)/conf.py $(wildcard $(srcdir)/$(BOO
7083
done
7184
endif
7285

86+
.PHONY: books-upload
87+
books-upload: all
88+
if BUILD_SPHINX_DOCS
89+
@echo "Uploading $(PACKAGE_SERIES) documentation set"
90+
@for book in $(BOOKS); do \
91+
echo " * $$book"; \
92+
buildfile="$$book/_build/build-$(PACKAGE_SERIES).txt"; \
93+
echo "Generated on `date --utc` from version $(TAG)" \
94+
> "$$buildfile"; \
95+
rsync $(RSYNC_OPTS) "$$buildfile" \
96+
$(BOOK_FORMATS:%=$$book/_build/%) \
97+
"$(BOOK_RSYNC_DEST)/$$book/"; \
98+
done
99+
endif
100+
73101
all-local:
74102
if BUILD_SPHINX_DOCS
75103
@for book in $(BOOKS); do \

0 commit comments

Comments
 (0)