Mercurial > p > roundup > code
annotate website/www/Makefile @ 8044:f9eaaa63fda2
build: update website build to sync built files
Sourceforge only supports python 2.7. Newer version of sphinx are
required to build docs and they don't work with 2.7.
Set up rsync targets that:
1) copy html build directory to sourceforge target directory
(dev_docs, production and user home directory)
2) backup existing sourceforge target directory re-sync so it
can be served without any missing files.
The Makefile now check to see if .orig or *~ files are present in the
html build tree. It lists the garbage file and fails if so.
Also inserts a .htaccess into the tree to prevent access to:
.buildinfo file
docs_backup-* files
*.orig
*~
The first one is a build artifact from newer version of sphinx.
The second is the backup directory created with all the original files
before a rsync from the local system is done to sourceforge. The backup
directory is timestamped with the time of its sync.
The last two are probably redundant since make html will fail if they
exist.
To rollback a sync:
move the target directory to a new name.
move the backup directory (in the renamed target directory) to the
old target directory name.
I added the --delete flag to remove files missing from the html
directory. Using the -no-times flags will create all new files with
the current directory. Using the --backup, --backup-dir flags backs up
all replaced/deleted files to backup-dir. The --exclude flag preserves
the backup directories on the sourceforge side. Without --exclude the
-delete flag would remove these backup-dir's. Note that
--delete-exclude must not be used otherwise the backup directories
will be deleted.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 26 Jun 2024 19:11:35 -0400 |
| parents | 2ab234484708 |
| children | 6d4b5005abf2 |
| rev | line source |
|---|---|
|
4035
e4950073153f
Adjust to better sync with roundup docs.
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
4022
diff
changeset
|
1 TMP := _tmp |
|
e4950073153f
Adjust to better sync with roundup docs.
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
4022
diff
changeset
|
2 HTML := html |
|
4022
d62831da3941
svn repository setup
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
diff
changeset
|
3 |
|
4035
e4950073153f
Adjust to better sync with roundup docs.
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
4022
diff
changeset
|
4 .PHONY: help clean html linkcheck |
|
4022
d62831da3941
svn repository setup
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
diff
changeset
|
5 |
|
d62831da3941
svn repository setup
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
diff
changeset
|
6 help: |
|
d62831da3941
svn repository setup
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
diff
changeset
|
7 @echo "Please use \`make <target>' where <target> is one of" |
|
d62831da3941
svn repository setup
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
diff
changeset
|
8 @echo " html to make standalone HTML files" |
|
d62831da3941
svn repository setup
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
diff
changeset
|
9 @echo " linkcheck to check all external links for integrity" |
|
7494
022b7112c171
Add target to push production www docs.
John Rouillard <rouilj@ieee.org>
parents:
7445
diff
changeset
|
10 @echo " sourceforge_prod_sync sync html directory to sourceforce" |
|
022b7112c171
Add target to push production www docs.
John Rouillard <rouilj@ieee.org>
parents:
7445
diff
changeset
|
11 @echo " production website" |
|
022b7112c171
Add target to push production www docs.
John Rouillard <rouilj@ieee.org>
parents:
7445
diff
changeset
|
12 @echo " sourceforge_dev_sync sync html directory to sourceforce" |
|
022b7112c171
Add target to push production www docs.
John Rouillard <rouilj@ieee.org>
parents:
7445
diff
changeset
|
13 @echo " /dev_docs subdirectory" |
|
022b7112c171
Add target to push production www docs.
John Rouillard <rouilj@ieee.org>
parents:
7445
diff
changeset
|
14 @echo " clean remove all produced files" |
|
4022
d62831da3941
svn repository setup
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
diff
changeset
|
15 clean: |
|
4703
8e34362a14f7
issue2550774: Fix generating the website documentation
John Kristensen <john@jerrykan.com>
parents:
4609
diff
changeset
|
16 -rm -rf $(TMP) $(HTML) docs COPYING.txt |
|
4022
d62831da3941
svn repository setup
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
diff
changeset
|
17 |
|
4609
9ed905019303
website docs: Added link to Makefile and adapted the hg command needed for sf.
Bernhard Reiter <bernhard@intevation.de>
parents:
4553
diff
changeset
|
18 docs: |
|
9ed905019303
website docs: Added link to Makefile and adapted the hg command needed for sf.
Bernhard Reiter <bernhard@intevation.de>
parents:
4553
diff
changeset
|
19 ln -s ../../doc ./docs |
|
4703
8e34362a14f7
issue2550774: Fix generating the website documentation
John Kristensen <john@jerrykan.com>
parents:
4609
diff
changeset
|
20 ln -s ../../COPYING.txt |
|
4609
9ed905019303
website docs: Added link to Makefile and adapted the hg command needed for sf.
Bernhard Reiter <bernhard@intevation.de>
parents:
4553
diff
changeset
|
21 |
|
6666
54af7ce65e6e
Add canonical url link in header
John Rouillard <rouilj@ieee.org>
parents:
6374
diff
changeset
|
22 # after upgrade to sphinx 1.8.5, search.html is missing load of searchtools. |
|
54af7ce65e6e
Add canonical url link in header
John Rouillard <rouilj@ieee.org>
parents:
6374
diff
changeset
|
23 # fix that in postprocess |
|
6668
4eee1aa1103e
reimplment meta opengraph removed in changeset 6628:2bb6d7baa47d
John Rouillard <rouilj@ieee.org>
parents:
6666
diff
changeset
|
24 # also sed index.html to properly format meta og:... entries. |
|
4609
9ed905019303
website docs: Added link to Makefile and adapted the hg command needed for sf.
Bernhard Reiter <bernhard@intevation.de>
parents:
4553
diff
changeset
|
25 html: docs |
|
6763
d93b441ee778
Handle build issues, update css for mobile
John Rouillard <rouilj@ieee.org>
parents:
6668
diff
changeset
|
26 rm -rf html |
|
4035
e4950073153f
Adjust to better sync with roundup docs.
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
4022
diff
changeset
|
27 mkdir -p $(TMP)/doctrees $(HTML) |
|
6374
977e0ef08406
Enable nitpick mode and warnings as errors for html generation
John Rouillard <rouilj@ieee.org>
parents:
4703
diff
changeset
|
28 sphinx-build -n -W -b html -d $(TMP)/doctrees . $(HTML) |
|
6763
d93b441ee778
Handle build issues, update css for mobile
John Rouillard <rouilj@ieee.org>
parents:
6668
diff
changeset
|
29 # install searchtools.js into search page. |
|
6666
54af7ce65e6e
Add canonical url link in header
John Rouillard <rouilj@ieee.org>
parents:
6374
diff
changeset
|
30 grep 'searchtools.js' html/search.html || sed -i -e '/language_data.js/s#</script>#</script>\n <script type="text/javascript" src="_static/searchtools.js"></script>#' html/search.html |
|
6763
d93b441ee778
Handle build issues, update css for mobile
John Rouillard <rouilj@ieee.org>
parents:
6668
diff
changeset
|
31 # sphinx inserts \: for : in meta tags. Get rid of the \ in |
|
d93b441ee778
Handle build issues, update css for mobile
John Rouillard <rouilj@ieee.org>
parents:
6668
diff
changeset
|
32 # opengraph tags |
|
6811
075a2f6d703b
fix opengraph meta tags name should be property.
John Rouillard <rouilj@ieee.org>
parents:
6763
diff
changeset
|
33 sed -i -e '/<meta/s/og\\:/og:/' \ |
|
075a2f6d703b
fix opengraph meta tags name should be property.
John Rouillard <rouilj@ieee.org>
parents:
6763
diff
changeset
|
34 -e '/<meta/s/name="og:/property="og:/' html/index.html |
|
6763
d93b441ee778
Handle build issues, update css for mobile
John Rouillard <rouilj@ieee.org>
parents:
6668
diff
changeset
|
35 cp robots.txt html/robots.txt |
|
7428
186956a87ad7
issue2551279 - GPG support removed from pypi - rewrite pgp signature validation.
John Rouillard <rouilj@ieee.org>
parents:
6811
diff
changeset
|
36 mkdir html/signatures && cp signatures/*.asc html/signatures |
|
7787
2ab234484708
docs: add older docs and link them from a Sphinx controlled doc
John Rouillard <rouilj@ieee.org>
parents:
7494
diff
changeset
|
37 cp --no-clobber -r docs/html_extra/. html/docs/. |
|
8044
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
38 cp htaccess html/.htaccess |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
39 @echo; \ |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
40 l=$$(find html -name '*.orig' -o -name '*~' | tee /dev/tty | wc -l);\ |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
41 if [ $$l -ne 0 ]; then echo "Garbage files found" && false; fi |
|
4022
d62831da3941
svn repository setup
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
diff
changeset
|
42 |
|
d62831da3941
svn repository setup
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
diff
changeset
|
43 linkcheck: |
|
4035
e4950073153f
Adjust to better sync with roundup docs.
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
4022
diff
changeset
|
44 mkdir -p $(TMP)/linkcheck $(TMP)/doctrees |
|
e4950073153f
Adjust to better sync with roundup docs.
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
4022
diff
changeset
|
45 sphinx-build -b linkcheck -d $(TMP)/doctrees . $(TMP)/linkcheck |
|
4022
d62831da3941
svn repository setup
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
diff
changeset
|
46 @echo |
|
d62831da3941
svn repository setup
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
diff
changeset
|
47 @echo "Link check complete; look for any errors in the above output " \ |
|
d62831da3941
svn repository setup
Stefan Seefeld <stefan@users.sourceforge.net>
parents:
diff
changeset
|
48 "or in .build/linkcheck/output.txt." |
|
7445
abc2ec25b3d1
add target to push to sourceforge dev_docs area.
John Rouillard <rouilj@ieee.org>
parents:
7428
diff
changeset
|
49 |
|
abc2ec25b3d1
add target to push to sourceforge dev_docs area.
John Rouillard <rouilj@ieee.org>
parents:
7428
diff
changeset
|
50 sourceforge_dev_sync: |
|
8044
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
51 # --no-times makes _images/* and other files sync over every time |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
52 # so docs_backup-... is complete with all files and can be served |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
53 # as the docs tree. Without --no-times _static, _images and other |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
54 # directories are missing from the backup directory. |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
55 # Exclude docs_backup so it won't be deleted from sourceforge |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
56 # since: |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
57 # --delete-exclude |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
58 # IS NOT (and must not be) SET |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
59 read -p "sync to dev_docs y/N? " resp; echo "$$resp" | grep -i "^y" |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
60 rsync -av --no-times --delete --exclude 'docs_backup*' \ |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
61 --backup --backup-dir docs_backup-`date --iso-8601=seconds` \ |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
62 html/. \ |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
63 web.sourceforge.net:/home/project-web/roundup/htdocs/dev_docs/. |
|
7494
022b7112c171
Add target to push production www docs.
John Rouillard <rouilj@ieee.org>
parents:
7445
diff
changeset
|
64 |
|
022b7112c171
Add target to push production www docs.
John Rouillard <rouilj@ieee.org>
parents:
7445
diff
changeset
|
65 sourceforge_prod_sync: |
|
022b7112c171
Add target to push production www docs.
John Rouillard <rouilj@ieee.org>
parents:
7445
diff
changeset
|
66 read -p "sync to production y/N? " resp; echo "$$resp" | grep -i "^y" |
|
8044
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
67 rsync -av --no-times --delete --exclude 'docs_backup*' \ |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
68 --backup --backup-dir docs_backup-`date --iso-8601=seconds` \ |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
69 html/. \ |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
70 web.sourceforge.net:/home/project-web/roundup/htdocs/. |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
71 |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
72 sourceforge_home_sync: |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
73 read -p "sync to home y/N? " resp; echo "$$resp" | grep -i "^y" |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
74 rsync -av --no-times --delete --exclude 'docs_backup*' \ |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
75 --backup --backup-dir docs_backup-`date --iso-8601=seconds` \ |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
76 html/. \ |
|
f9eaaa63fda2
build: update website build to sync built files
John Rouillard <rouilj@ieee.org>
parents:
7787
diff
changeset
|
77 web.sourceforge.net:roundup_docs/. |
