X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=docs%2Fscripts%2Fsphinx-make.sh;h=532225e488e78a4ce903a0958611ad37f3f69132;hb=b93782b36643714a8dcb53e2e396da642b1b0053;hp=36596f219f53e0dc56b6c5e9491d27c81ccfd9e4;hpb=727c653f1cac63590f28ca73619655c1c2d109fa;p=vpp.git diff --git a/docs/scripts/sphinx-make.sh b/docs/scripts/sphinx-make.sh index 36596f219f5..532225e488e 100755 --- a/docs/scripts/sphinx-make.sh +++ b/docs/scripts/sphinx-make.sh @@ -1,21 +1,31 @@ -#!/bin/bash +#!/bin/bash -ex + +# Not refactored to root Makefile because CI calls this from +# makefile in /docs (as if 'make -C docs'). +if [ -z "$PYTHON" ] +then +PYTHON_INTERP=python3 +else +PYTHON_INTERP=$(PYTHON) +fi + +# Get the OS +OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') +OS_VERSION=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') +PIP_VERSION=$(grep 'PIP_VERSION=' $WS_ROOT/test/Makefile | cut -d'=' -f2) +PIP_TOOLS_VERSION=$(grep 'PIP_TOOLS_VERSION=' $WS_ROOT/test/Makefile | cut -d'=' -f2) if [ "$1" == "venv" ] then - OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') - if [ "$OS_ID" == "ubuntu" ] - then - sudo apt-get install -y python3-pip - fi - if [ "$OS_ID" == "centos" ] - then - sudo yum install -y python3-pip - fi - pip3 install --user virtualenv - python3 -m virtualenv $VENV_DIR + + # Install the virtual environment + $PYTHON_INTERP -m venv $VENV_DIR source $VENV_DIR/bin/activate; - pip3 install -r $DOCS_DIR/etc/requirements.txt + $PYTHON_INTERP -m pip install pip==$PIP_VERSION + $PYTHON_INTERP -m pip install pip-tools==$PIP_TOOLS_VERSION + $PYTHON_INTERP -m pip install -r $WS_ROOT/test/requirements-3.txt else + [ -n "$(declare -f deactivate)" ] && deactivate source $VENV_DIR/bin/activate; VERSION=`source $WS_ROOT/src/scripts/version` TM=`TZ=GMT date`