docs: fix missing dependency on pip-tools for docs-venv
[vpp.git] / docs / scripts / sphinx-make.sh
1 #!/bin/bash -ex
2
3 # Not refactored to root Makefile because CI calls this from
4 # makefile in /docs (as if 'make -C docs').
5 if [ -z "$PYTHON" ]
6 then
7 PYTHON_INTERP=python3
8 else
9 PYTHON_INTERP=$(PYTHON)
10 fi
11
12 # Get the OS
13 OS_ID=$(grep '^ID=' /etc/os-release  | cut -f2- -d= | sed -e 's/\"//g')
14 OS_VERSION=$(grep '^VERSION_ID=' /etc/os-release  | cut -f2- -d= | sed -e 's/\"//g')
15 PIP_VERSION=$(grep 'PIP_VERSION=' $WS_ROOT/test/Makefile | cut -d'=' -f2)
16 PIP_TOOLS_VERSION=$(grep 'PIP_TOOLS_VERSION=' $WS_ROOT/test/Makefile | cut -d'=' -f2)
17
18 if [ "$1" == "venv" ]
19 then
20
21     # Install the virtual environment
22     $PYTHON_INTERP -m venv $VENV_DIR
23     source $VENV_DIR/bin/activate;
24     $PYTHON_INTERP -m pip install pip==$PIP_VERSION
25     $PYTHON_INTERP -m pip install pip-tools==$PIP_TOOLS_VERSION
26     $PYTHON_INTERP -m pip install -r $WS_ROOT/test/requirements-3.txt
27 else
28     [ -n "$(declare -f deactivate)" ] && deactivate
29     source $VENV_DIR/bin/activate;
30     VERSION=`source $WS_ROOT/src/scripts/version`
31     TM=`TZ=GMT date`
32     sed -ie "s/**VPP Version:\*\* .*/**VPP Version:** $VERSION/" $DOCS_DIR/about.rst
33     sed -ie "s/**Built on:\*\* .*/**Built on:** $TM/" $DOCS_DIR/about.rst
34     rm $DOCS_DIR/about.rste
35     make -C $DOCS_DIR $1
36 fi
37
38 deactivate