Add error check for doc-tools-check-languages

Use -xe for bash invocation so that log contains all commands executed
and any failure will abort the build.

Change-Id: Ic59515bec3ae7ea9cb1d2bd97e05d95e006eafb8
This commit is contained in:
Andreas Jaeger 2016-11-18 16:45:38 +01:00
parent 5d48d9738b
commit 387e8288c7
1 changed files with 7 additions and 11 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -xe
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
@ -12,7 +12,6 @@
# License for the specific language governing permissions and limitations
# under the License.
BUILD_FAIL=0
INSTALL_TAGS="obs rdo ubuntu debian debconf"
FIRSTAPP_TAGS="libcloud dotnet fog openstacksdk pkgcloud shade"
@ -23,6 +22,7 @@ MARKER_TEXT="Project: $ZUUL_PROJECT Ref: $ZUUL_REFNAME Build: $ZUUL_UUID"
function build_rst {
language=$1
book=$2
local ret
# First build all the single po files
# Note that we need to run inside a venv since the venv we are run in
@ -72,8 +72,11 @@ function build_rst {
done
# Set the bug project to I18n project
set +e
grep 'bug_project' ${DOC_DIR}${book}/source/conf.py > /dev/null
if [ "$?" -eq 0 ] ; then
ret=$?
set -e
if [ "$ret" -eq 0 ] ; then
# Replace the existing "bug_project" html context
sed -i -e \
's/"bug_project" *: *[^ ,}]*/"bug_project": "openstack-i18n"/' \
@ -205,12 +208,6 @@ function test_language {
if [ ${SPECIAL_BOOKS[$book]} = "RST" ] ; then
echo "Building translated RST book $book for $language"
build_rst $language $book
if [[ $? -eq 0 ]] ; then
echo "... succeeded"
else
echo "... failed"
BUILD_FAIL=1
fi
continue
fi
fi
@ -324,7 +321,6 @@ for language in "$@" ; do
handle_draft_language $language
fi
else
BUILD_FAIL=1
echo "Error: language $language not handled"
fi
;;
@ -332,4 +328,4 @@ for language in "$@" ; do
done
exit $BUILD_FAIL
exit 0