| 1 |
#!/usr/bin/env bash |
| 2 |
|
| 3 |
# build_docs.sh: Build the documentation as part of Travis CI. |
| 4 |
|
| 5 |
set -o errexit |
| 6 |
|
| 7 |
bold=$(tput bold) |
| 8 |
normal=$(tput sgr0) |
| 9 |
|
| 10 |
if [ -z ${DOCS_BUILD_DIR+x} ]; then |
| 11 |
echo "${bold}\$DOCS_BUILD_DIR is not set!${normal}" |
| 12 |
exit 1 |
| 13 |
elif [ -z ${THEME_DIR+x} ]; then |
| 14 |
echo "${bold}\$THEME_DIR is not set!${normal}" |
| 15 |
exit 1 |
| 16 |
fi |
| 17 |
|
| 18 |
git clone -b cclib \ |
| 19 |
"https://[email protected]/cclib/sphinx_rtd_theme.git" \ |
| 20 |
"${THEME_DIR}"/sphinx_rtd_theme |
| 21 |
|
| 22 |
install -dm755 "${DOCS_BUILD_DIR}" |
| 23 |
touch "${DOCS_BUILD_DIR}"/.nojekyll |
| 24 |
|
| 25 |
pushd "${DOCS_BUILD_DIR}"/../.. |
| 26 |
make default |
| 27 |
popd |
| 28 |
|
| 29 |
TEST_COVERAGE_DIR="${TRAVIS_BUILD_DIR}/htmlcov" |
| 30 |
if [[ -d "${TEST_COVERAGE_DIR}" ]]; then |
| 31 |
echo "${bold}Copying test coverage results...${normal}" |
| 32 |
mv "${TEST_COVERAGE_DIR}" "${DOCS_BUILD_DIR}"/coverage |
| 33 |
fi |