forked from dylan-lang/website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.sh
More file actions
executable file
·80 lines (65 loc) · 3.02 KB
/
update.sh
File metadata and controls
executable file
·80 lines (65 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash -xe
# This script assumes that all repos (website, opendylan, and various
# libraries) are checked out into the same directory. To test, clone all
# necessary repositories (including this one) into a single directory and then:
#
# mkdir /tmp/www; ./website/update.sh /tmp/www .
# /var/www/opendylan.org/downloads is handled specially. New versions of Open
# Dylan must be installed there by hand and then download/index.html must be
# updated in the website repo.
# TODO:
# * Fix latexpdf vs python3 issues. Disabled PDF for now.
# * Link to GitHub releases for the download pages instead of maintaining
# downloads by hand.
# * Clone repos if not already present. This should use the package manager
# since they're spread across different GitHub orgs and we don't want to
# maintain that info in multiple places.
# * Build/install dylan-programming-book into ${dest_dir}/books/dpg.
# * Build/install dylan-reference-manual into ${dest_dir}/books/drm.
if [[ $# -ne 2 ]]; then
echo "Usage: `basename $0` dest_dir repo_dir"
echo " dest_dir: directory in which to build the website. e.g. /var/www/opendylan.org"
echo " repo_dir: directory containing all necessary git repos"
exit 2
fi
dest_dir=$(realpath "$1")
repo_dir=$(realpath "$2") # so we can cd with wild abandon below
# Update the main web site pages.
cd ${repo_dir}/website
git pull --rebase origin master
git submodule update --recursive --init
make html
rsync -avz build/html/ ${dest_dir}
# Update the docs contained in the opendylan repository.
subdirs="building-with-duim duim-reference getting-started-cli getting-started-ide"
subdirs="${subdirs} hacker-guide intro-dylan library-reference man-pages"
subdirs="${subdirs} project-notebook release-notes style-guide"
cd ${repo_dir}/opendylan
git pull --rebase origin master
git submodule update --recursive --init
export PYTHONPATH=${repo_dir}/opendylan/documentation/sphinx-extensions
for subdir in ${subdirs}; do
cd ${repo_dir}/opendylan/documentation/${subdir}
make html && rsync -avz build/html/ ${dest_dir}/documentation/${subdir}/
make epub && cp build/epub/*.epub ${dest_dir}/documentation/${subdir}/
# Disable PDF for now. For some reason it blows out the tex stack in python3.
# make latexpdf && cp build/latex/*.pdf ${dest_dir}/documentation/${subdir}/
done
# Update library docs.
# For now these are one-offs, until we decide on a standard.
libraries="binary-data concurrency http melange objc-dylan statistics testworks tracing"
for lib in ${libraries}; do
echo
echo "Building documentation for library ${lib}..."
cd ${repo_dir}/${lib}
git pull --rebase origin master
git submodule update --recursive --init
cd ${repo_dir}/${lib}/documentation
if [[ "${lib}" == "testworks" ]]; then
cd users-guide
fi
make html && rsync -avz build/html/ ${dest_dir}/documentation/${lib}/
make epub && cp build/epub/*.epub ${dest_dir}/documentation/${lib}/
# Disable PDF for now.
# make latexpdf && cp build/latex/*.pdf ${dest_dir}/documentation/${lib}/
done