summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2016-10-18 11:49:58 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2016-12-01 11:39:57 +0800
commit80c1b9a92d02a2a565876092d0495dd79d3ed2c6 (patch)
tree79650ca01d2f06f2ea355e9b657518a80700fb0d /scripts
parentd438301ca7244e66d5082312e3e84fcfb219f11b (diff)
Exit script with error count
related JIRA: DOCS-71 Change-Id: I08501e6193dc555ebbb7b4b69af65e50ef4be5b7 Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/docs-build.sh18
1 files changed, 14 insertions, 4 deletions
diff --git a/scripts/docs-build.sh b/scripts/docs-build.sh
index 0483fce05..c912bdf8c 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}
@@ -25,6 +27,12 @@ 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."
+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)