summaryrefslogtreecommitdiffstats
path: root/bin/build-web-site
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2013-10-04 22:56:26 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2013-10-04 22:56:26 (GMT)
commit84c4a5d24cbef536b8248a3d8ff72bb2b4248c29 (patch)
treeaa5eaf24f84315ea5fa143bf287c9fcf7857391f /bin/build-web-site
parent45d3e695be499cf9f9956c223883073fc20d48b4 (diff)
downloadsite-84c4a5d24cbef536b8248a3d8ff72bb2b4248c29.tar.gz
Add test instance of the web site
Serve https://www.nagios-plugins.org:444/ from the "test" branch of this repository.
Diffstat (limited to 'bin/build-web-site')
-rwxr-xr-xbin/build-web-site41
1 files changed, 26 insertions, 15 deletions
diff --git a/bin/build-web-site b/bin/build-web-site
index 95ac355..9886b7a 100755
--- a/bin/build-web-site
+++ b/bin/build-web-site
@@ -16,31 +16,42 @@ set -e
16set -u 16set -u
17 17
18prefix='/home/plugins' 18prefix='/home/plugins'
19poole_dir="$prefix/web/generator" 19
20site_source_dir="$prefix/exported/site/web/content" 20export PATH="$prefix/src/poole:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin"
21site_target_dir="$poole_dir/input" 21
22myself=${0##*/}
22man_source_dir="$prefix/web/work/man" 23man_source_dir="$prefix/web/work/man"
23man_target_dir="$site_target_dir/doc/man"
24guidelines_source="$prefix/web/work/guidelines.html" 24guidelines_source="$prefix/web/work/guidelines.html"
25guidelines_target="$site_target_dir/doc/guidelines.html" 25site_target_dir=$(mktemp -d "/tmp/$myself.XXXXXX")
26man_target_dir="$site_target_dir/input/doc/man"
27guidelines_target="$site_target_dir/input/doc/guidelines.html"
26 28
27export PATH="$prefix/src/poole:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin" 29trap 'rm -rf "$site_target_dir"' EXIT
30
31if [ $# -gt 0 ] && [ "$1" = '-t' ]
32then # Build test instance.
33 site_source_dir="$prefix/exported/site-test/web"
34 output_dir="$prefix/web/test"
35else
36 site_source_dir="$prefix/exported/site/web"
37 output_dir="$prefix/web/site"
38fi
28 39
29# 40#
30# Collect the pieces of the site. 41# Collect the pieces of the site, and create a link to the output directory.
31# 42#
32rsync -aH --delete "$site_source_dir/" "$site_target_dir" 43rsync -aH "$site_source_dir/" "$site_target_dir"
33rsync -aH "$man_source_dir/" "$man_target_dir" 44rsync -aH "$man_source_dir/" "$man_target_dir"
34cp -p "$guidelines_source" "$guidelines_target" 45cp -p "$guidelines_source" "$guidelines_target"
35 46ln -s "$output_dir" "$site_target_dir/output"
36cd "$poole_dir"
37 47
38# 48#
39# See http://pythonhosted.org/Markdown/extensions/ for documentation on the 49# See http://pythonhosted.org/Markdown/extensions/ for documentation on the
40# extensions. 50# extensions.
41# 51#
42exec poole.py --build \ 52poole.py --build \
43 --md-ext='extra' \ 53 --md-ext='extra' \
44 --md-ext='headerid' \ 54 --md-ext='headerid' \
45 --md-ext='toc' \ 55 --md-ext='toc' \
46 --md-ext='wikilinks' 56 --md-ext='wikilinks' \
57 "$site_target_dir"