X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=scripts%2Fdocs-build.sh;h=69f962505d852320488bcb7f7100690b8a398b83;hb=9afe44b2870497842e4346290d10cb38abe73166;hp=0483fce0550df1e862c875c156b3c2118ef89727;hpb=3b31cde35302849a809de6f422ed970919ae5112;p=opnfvdocs.git diff --git a/scripts/docs-build.sh b/scripts/docs-build.sh index 0483fce05..69f962505 100755 --- a/scripts/docs-build.sh +++ b/scripts/docs-build.sh @@ -8,6 +8,8 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +set +e + DOCS_DIR=${DOCS_DIR:-docs} INDEX_RST=${INDEX_RST:-index.rst} BUILD_DIR=${BUILD_DIR:-docs_build} @@ -19,12 +21,18 @@ GERRIT_COMMENT=${GERRIT_COMMENT:-} revision="$(git rev-parse --short HEAD)" rev_full="$(git rev-parse HEAD)" -version="$(git describe --abbrev=0 2> /dev/null || echo draft) ($revision)" +version="$(git tag | tail -1)" project="$(basename $(git rev-parse --show-toplevel))" html_notes=" Revision: $rev_full\n Build date: $(date -u +'%Y-%m-%d')" opnfv_logo="$OPNFVDOCS_DIR/etc/opnfv-logo.png" copyright="$(date +%Y), OPNFV." -copyrightlong="$(date +%Y), OPNFV. Licenced under CC BY 4.0." +copyrightlong="$(date +%Y), OPNFV. Licensed under CC BY 4.0." +error_count=0 + +function set_error() { + # TODO(yujunz) log detail errors + error_count=$((error_count + 1)) +} if [ "$(uname)" == "Darwin" ]; then # Override system $SED/$FIND with gnu $SED and gnu $FIND @@ -151,8 +159,8 @@ function generate_name_for_top_dir() { return done - echo "Error: cannot $FIND name for top directory [$DOCS_DIR]" - exit 1 + echo "Error: cannot find name for top directory [$DOCS_DIR]" + set_error } function generate_name() { @@ -171,12 +179,12 @@ function generate_name() { if [[ ! -d "$OPNFVDOCS_DIR" ]] ; then echo "Error: $OPNFVDOCS_DIR dir not found." echo "See http://artifacts.opnfv.org/opnfvdocs/docs/how-to-use-docs ." - exit 1 + set_error fi if ! which virtualenv > /dev/null ; then echo "Error: 'virtualenv' not found. Exec 'sudo pip install virtualenv' first." - exit 1 + set_error fi # workaround for doc8 error in python2.6 @@ -249,3 +257,5 @@ do done deactivate + +exit $error_count