From f563022aa89949642da31ab7f87ecb6345429e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Fri, 15 Jun 2018 11:03:35 +0200 Subject: [PATCH] Refactor baseimage building to baseimage.sh --- hack/libhack/baseimage.sh | 21 +++++++++++++++++++++ hack/tfw.sh | 24 +----------------------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/hack/libhack/baseimage.sh b/hack/libhack/baseimage.sh index 486659d..742a697 100644 --- a/hack/libhack/baseimage.sh +++ b/hack/libhack/baseimage.sh @@ -39,6 +39,27 @@ baseimage::release() { popd } +baseimage::builddocs() { + 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 +} + releasename() { local version local date diff --git a/hack/tfw.sh b/hack/tfw.sh index c75d28d..3f4c59a 100755 --- a/hack/tfw.sh +++ b/hack/tfw.sh @@ -79,28 +79,6 @@ 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} @@ -127,7 +105,7 @@ case ${1:-} in [[ -d "$BASEIMAGE_PATH" ]] && baseimage::release ;; builddocs) - build_docs + baseimage::builddocs ;; *) echo "Usage: tfw.sh [start|buildtfw|build|buildwithfrontend|releasetfw]"