run-docs.sh: execute docs job if present

Some projects (like neutron) provide their own docs job, so we should
use it instead of running build_sphinx directly.

The use case to maintain a custom docs job is f.e. to enable sphinx
warnings in gate. They were enabled before for neutron under assumption
that gate relies on the job, but it's not the case, as it turned out.

Note that projects that want to expose the tox job to gate should have
it defined in tox envlist so that 'tox -l' returns it.

Depends-On: I80eb169b7b4e5a3490586722c64394dbb724928d
Depends-On: Id276fa59edb33f7789ab06055300b4dc2385472a
Depends-On: I8c265eae2175425568479116d1faef7d87fdcc02
Change-Id: I433126a8247e7e1c316f2c96bb21e15582b247ce
This commit is contained in:
Ihar Hrachyshka 2015-06-15 16:18:49 +02:00
parent fbec462ef8
commit 0ced503c27

View File

@ -7,11 +7,15 @@
# what packages we ended up testing.
#
venv=venv
mkdir -p doc/build
export HUDSON_PUBLISH_DOCS=1
tox -e$venv -- python setup.py build_sphinx
if [ "`tox -l | grep docs`" = "docs" ]; then
venv=docs
tox -e$venv
else
venv=venv
tox -e$venv -- python setup.py build_sphinx
fi
result=$?
[ -e .tox/$venv/bin/pbr ] && freezecmd=pbr || freezecmd=pip