training-guides/tox.ini
Andreas Jaeger 73f516772f Publish to publish-docs/html
This allows simplifying the CI jobs.

Depends-On: https://review.opendev.org/676489
Change-Id: I955f360bcff9affe209b3bf201258828911c251d
2019-08-15 06:44:32 +02:00

82 lines
2.9 KiB
INI

[tox]
minversion = 3.1.1
envlist = checkbuild
skipsdist = True
ignore_basepython_conflict = True
[testenv]
basepython = python3
setenv = VIRTUAL_ENV={envdir}
install_command = pip install -U {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals =
echo
mkdir
rm
rsync
msgcat
awk
bash
[testenv:venv]
commands = {posargs}
[doc8]
# Settings for doc8:
# File extensions to use
extension = .rst,.txt
ignore-path = doc/upstream-training/build/*,doc/training-guides/build/*
[testenv:checkbuild]
commands =
{[testenv:upstream-slides]commands}
{[testenv:training-slides]commands}
# Publish for check site
mkdir -p publish-docs/html/upstream-training
mkdir -p publish-docs/html/training-guides
rsync -av doc/upstream-training/build/slides/ publish-docs/html/upstream-training/
rsync -av doc/training-guides/build/slides/ publish-docs/html/training-guides/
[testenv:generatepot-training]
# Generate POT files for translation
commands =
rm -f doc/upstream-training/source/locale/upstream-training.pot
sphinx-build -b gettext doc/upstream-training/source/slides \
doc/upstream-training/source/locale/
sphinx-build -b gettext doc/upstream-training/source/website \
doc/upstream-training/source/locale/
bash -c "msgcat --use-first --sort-by-file doc/upstream-training/source/locale/*.pot | \
awk '$0 !~ /^\# [a-z0-9]+$/' > doc/upstream-training/source/upstream-training.pot && \
rm doc/upstream-training/source/locale/*.pot && \
rm -rf doc/upstream-training/source/locale/.doctrees/ && \
mv doc/upstream-training/source/upstream-training.pot doc/upstream-training/source/locale/upstream-training.pot"
[testenv:publishdocs]
passenv = ZUUL*
commands =
{[testenv:upstream-slides]commands}
# Publish
mkdir -p publish-docs/html/upstream-training
rsync -av doc/upstream-training/build/slides/ publish-docs/html/upstream-training/
{toxinidir}/tools/add-marker.sh publish-docs/html/upstream-training
# Publish translated guides
{toxinidir}/tools/buildlang.sh
[testenv:upstream-slides]
commands =
# Niceness test
doc8 doc/upstream-training
# Build upstream-training slides
sphinx-build -W -b slides -d doc/upstream-training/build/slides.doctrees doc/upstream-training/source/slides doc/upstream-training/build/slides
# Build upstream landing page index.html
sphinx-build -W -b html -d doc/upstream-training/build/slides.doctrees doc/upstream-training/source/website doc/upstream-training/build/slides
[testenv:training-slides]
commands =
# Niceness test
doc8 doc/training-guides
# Build training-guides slides
sphinx-build -W -b slides -d doc/training-guides/build/slides.doctrees/associate-guide doc/training-guides/source/slides doc/training-guides/build/slides/associate-guide
# Build training-guides landing page index.html
sphinx-build -b html -d doc/training-guides/build/slides.doctrees doc/training-guides/source/website doc/training-guides/build/slides