-
Notifications
You must be signed in to change notification settings - Fork 8
/
post_compile
45 lines (32 loc) · 1.1 KB
/
post_compile
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
#!/usr/bin/env bash
set -eo pipefail
indent() {
sed "s/^/ /"
}
puts-step() {
echo "-----> $*"
}
puts-warn() {
echo " ! $*"
}
# Set graphviz path
export PATH=${BUILD_DIR}/.heroku-buildpack-graphviz/usr/bin:${PATH}
export GRAPHVIZ_DOT=${BUILD_DIR}/.heroku-buildpack-graphviz/usr/bin/dot
export LD_LIBRARY_PATH=${BUILD_DIR}/.heroku-buildpack-graphviz/usr/lib/x86_64-linux-gnu:${BUILD_DIR}/.heroku/vendor/lib/:${LD_LIBRARY_PATH}
puts-step "Setting up Sphinx environment"
# All requirements of wsgi.py
pip install -q static | indent
# Needed to serve the application (Procfile)
pip install -q waitress | indent
if [[ ! -f ${BUILD_DIR}/docs/requirements.txt ]]; then
puts-warn "docs/requirements.txt not found, installing Sphinx"
pip install -q Sphinx
else
pip install -qr ${BUILD_DIR}/docs/requirements.txt
fi;
# Get sphinx build-dir
echo -e "\necho-build-dir:\n\t@echo '\$(BUILDDIR)'\n" >> ${BUILD_DIR}/docs/Makefile
(cd ${BUILD_DIR}/docs && make echo-build-dir > ${BUILD_DIR}/docs/.build-dir)
puts-step "Build Sphinx docs"
# Build Sphinx documentation
(cd ${BUILD_DIR}/docs && make html) | indent