Rework localized tox scripts
Use tools/test-languages.sh as common script for all three tox jobs and parametrize it accordingly. This refactoring simplifies the setup and removes some duplication. Remove now obsolete file tools/copy_pom. Change-Id: I5590e836621fe58f761675132bdd71e3f1254174
This commit is contained in:
parent
88487d6a9b
commit
a7b79cb34c
@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
TARGET=$1
|
|
||||||
|
|
||||||
echo "copying pom.xml for $TARGET"
|
|
||||||
cp doc/pom.xml generated/$TARGET/pom.xml
|
|
@ -18,30 +18,81 @@ function setup_lang {
|
|||||||
cp doc/pom.xml generated/$SET_LANG/pom.xml
|
cp doc/pom.xml generated/$SET_LANG/pom.xml
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_manuals {
|
|
||||||
SET_LANG=$1
|
|
||||||
shift
|
|
||||||
for BOOK in "$@" ; do
|
|
||||||
echo "Building $BOOK for language $SET_LANG..."
|
|
||||||
setup_directory $SET_LANG $BOOK
|
|
||||||
openstack-doc-test --check-build -l $SET_LANG --only-book $BOOK
|
|
||||||
RET=$?
|
|
||||||
if [ "$RET" -eq "0" ] ; then
|
|
||||||
echo "... succeeded"
|
|
||||||
else
|
|
||||||
echo "... failed"
|
|
||||||
BUILD_FAIL=1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
function test_ja {
|
function test_ja {
|
||||||
setup_lang 'ja'
|
setup_lang 'ja'
|
||||||
test_manuals 'ja' 'security-guide' 'high-availability-guide' 'install-guide'
|
|
||||||
|
# Currently disabled since broken: 'user-guide' 'user-guide-admin'
|
||||||
|
case "$PURPOSE" in
|
||||||
|
test)
|
||||||
|
setup_directory 'ja' 'security-guide' 'high-availability-guide' 'install-guide'
|
||||||
|
openstack-doc-test --check-build -l ja \
|
||||||
|
--only-book security-guide \
|
||||||
|
--only-book high-availability-guide \
|
||||||
|
--only-book install-guide
|
||||||
|
RET=$?
|
||||||
|
;;
|
||||||
|
publish-install)
|
||||||
|
setup_directory 'ja' 'install-guide'
|
||||||
|
openstack-doc-test --publish --check-build -l ja \
|
||||||
|
--only-book install-guide
|
||||||
|
RET=$?
|
||||||
|
;;
|
||||||
|
publish)
|
||||||
|
setup_directory 'ja' 'security-guide' 'high-availability-guide'
|
||||||
|
openstack-doc-test --publish --check-build -l ja \
|
||||||
|
--only-book security-guide \
|
||||||
|
--only-book high-availability-guide
|
||||||
|
RET=$?
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if [ "$RET" -eq "0" ] ; then
|
||||||
|
echo "... succeeded"
|
||||||
|
else
|
||||||
|
echo "... failed"
|
||||||
|
BUILD_FAIL=1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_language () {
|
||||||
|
|
||||||
|
case "$language" in
|
||||||
|
ja)
|
||||||
|
test_ja
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
BUILD_FAIL=1
|
||||||
|
echo "Language $language not handled"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
function usage () {
|
||||||
|
echo "Call the script as: "
|
||||||
|
echo "$0 PURPOSE LANGUAGE1 LANGUAGE2..."
|
||||||
|
echo "PURPOSE is either 'test', 'publish' or 'publish-install'"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$#" -lt 2 ] ; then
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ "$1" = "test" ] ; then
|
||||||
|
PURPOSE="test"
|
||||||
|
elif [ "$1" = "publish" ] ; then
|
||||||
|
PURPOSE="publish"
|
||||||
|
elif [ "$1" = "publish-install" ] ; then
|
||||||
|
PURPOSE="publish-install"
|
||||||
|
else
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shift
|
||||||
BUILD_FAIL=0
|
BUILD_FAIL=0
|
||||||
test_ja
|
for language in "$@" ; do
|
||||||
|
echo
|
||||||
|
echo "Building for language $language"
|
||||||
|
echo
|
||||||
|
test_language "$language"
|
||||||
|
done
|
||||||
|
|
||||||
exit $BUILD_FAIL
|
exit $BUILD_FAIL
|
||||||
|
23
tox.ini
23
tox.ini
@ -52,7 +52,7 @@ commands =
|
|||||||
# use sitepackages.
|
# use sitepackages.
|
||||||
sitepackages=True
|
sitepackages=True
|
||||||
whitelist_externals = bash
|
whitelist_externals = bash
|
||||||
commands = bash tools/test-languages.sh
|
commands = bash tools/test-languages.sh test ja
|
||||||
|
|
||||||
[testenv:buildlang-install]
|
[testenv:buildlang-install]
|
||||||
# Run as "tox -e buildlang-install -- $LANG"
|
# Run as "tox -e buildlang-install -- $LANG"
|
||||||
@ -61,15 +61,7 @@ commands = bash tools/test-languages.sh
|
|||||||
# use sitepackages.
|
# use sitepackages.
|
||||||
sitepackages=True
|
sitepackages=True
|
||||||
whitelist_externals = bash
|
whitelist_externals = bash
|
||||||
commands =
|
commands = bash tools/test-languages.sh publish-install {posargs}
|
||||||
openstack-generate-docbook -l {posargs} -b common
|
|
||||||
openstack-generate-docbook -l {posargs} -b glossary
|
|
||||||
openstack-generate-docbook -l {posargs} -b install-guide
|
|
||||||
# tox 1.7 does not parse the following line:
|
|
||||||
# cp doc/pom.xml generated/{posargs}/pom.xml
|
|
||||||
# Thus replaced by the next one:
|
|
||||||
bash ./tools/copy_pom {posargs}
|
|
||||||
openstack-doc-test --check-build --publish -l {posargs} --only-book install-guide
|
|
||||||
|
|
||||||
[testenv:buildlang-misc]
|
[testenv:buildlang-misc]
|
||||||
# Run as "tox -e buildlang-misc -- $LANG"
|
# Run as "tox -e buildlang-misc -- $LANG"
|
||||||
@ -78,13 +70,4 @@ commands =
|
|||||||
# use sitepackages.
|
# use sitepackages.
|
||||||
sitepackages=True
|
sitepackages=True
|
||||||
whitelist_externals = bash
|
whitelist_externals = bash
|
||||||
commands =
|
commands = bash tools/test-languages.sh publish {posargs}
|
||||||
openstack-generate-docbook -l {posargs} -b common
|
|
||||||
openstack-generate-docbook -l {posargs} -b glossary
|
|
||||||
openstack-generate-docbook -l {posargs} -b security-guide
|
|
||||||
openstack-generate-docbook -l {posargs} -b high-availability-guide
|
|
||||||
# tox 1.7 does not parse the following line:
|
|
||||||
# cp doc/pom.xml generated/{posargs}/pom.xml
|
|
||||||
# Thus replaced by the next one:
|
|
||||||
bash ./tools/copy_pom {posargs}
|
|
||||||
openstack-doc-test --check-build --publish -l {posargs} --only-book security-guide --only-book high-availability-guide
|
|
||||||
|
Loading…
Reference in New Issue
Block a user