1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2024-11-12 19:37:16 +00:00

Implement in-container building of TFW sphinx documentation

This commit is contained in:
Kristóf Tóth 2018-06-08 14:11:03 +02:00
parent 154c4fa2ce
commit d21417ba0c

View File

@ -5,6 +5,7 @@ set -o errtrace
shopt -s expand_aliases
[ "$(uname)" == "Darwin" ] && alias readlink="greadlink" || :
here="$(pwd)"
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
TAO_PATH="${TAO_PATH:-$SCRIPT_DIR/../..}"
BASEIMAGE_REPO="${BASEIMAGE_REPO:-baseimage-tutorial-framework}"
@ -150,6 +151,28 @@ start_test()
wait
}
build_docs()
{
mount_point="/mnt/docs"
docker run --rm \
-ti \
-v "$BASEIMAGE_PATH"/docs:"$mount_point" \
"$BASEIMAGE_NAME" \
/bin/bash -c \
"cd $mount_point
pip3 install sphinx
make html
exit" \
&> /dev/null
if [ "$?" == "0" ]; then
echo "Built baseimage docs at ${BASEIMAGE_PATH}/docs/build/html!"
else
echo "Building baseimage docs failed!"
fi
}
case ${1:-} in
start)
RUN_FRONTEND=1 start_test ${@:2}
@ -175,6 +198,9 @@ case ${1:-} in
releasetfw)
release_baseimage
;;
builddocs)
build_docs
;;
*)
echo "Usage: tfw.sh [start|buildtfw|build|buildwithfrontend|releasetfw]"
echo " |--- start: build & run TFW test and Angular frontend"
@ -185,5 +211,6 @@ case ${1:-} in
echo " |--- build: build TFW baseimage and test"
echo " |--- buildwithfrontend: build TFW baseimage and test, include frontend in image"
echo " |--- releasetfw: tag TFW baseimage and push to upstream"
echo " |--- builddocs: build baseimage documentation (in docs/build/html)"
;;
esac