blob: 532225e488e78a4ce903a0958611ad37f3f69132 [file] [log] [blame]
Paul Vinciguerraa26f5442020-03-11 13:28:27 -04001#!/bin/bash -ex
2
3# Not refactored to root Makefile because CI calls this from
4# makefile in /docs (as if 'make -C docs').
5if [ -z "$PYTHON" ]
6then
7PYTHON_INTERP=python3
8else
9PYTHON_INTERP=$(PYTHON)
10fi
11
12# Get the OS
13OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
Jon Loeliger3227e492020-12-07 10:57:46 -050014OS_VERSION=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
Dave Wallaced1706812021-08-12 18:36:02 -040015PIP_VERSION=$(grep 'PIP_VERSION=' $WS_ROOT/test/Makefile | cut -d'=' -f2)
Dave Wallaceb93782b2021-08-17 15:11:43 -040016PIP_TOOLS_VERSION=$(grep 'PIP_TOOLS_VERSION=' $WS_ROOT/test/Makefile | cut -d'=' -f2)
jdenisco3138d722018-09-24 14:59:33 -040017
18if [ "$1" == "venv" ]
19then
Paul Vinciguerraa26f5442020-03-11 13:28:27 -040020
21 # Install the virtual environment
22 $PYTHON_INTERP -m venv $VENV_DIR
jdenisco3138d722018-09-24 14:59:33 -040023 source $VENV_DIR/bin/activate;
Dave Wallaced1706812021-08-12 18:36:02 -040024 $PYTHON_INTERP -m pip install pip==$PIP_VERSION
Dave Wallaceb93782b2021-08-17 15:11:43 -040025 $PYTHON_INTERP -m pip install pip-tools==$PIP_TOOLS_VERSION
Dave Wallaced1706812021-08-12 18:36:02 -040026 $PYTHON_INTERP -m pip install -r $WS_ROOT/test/requirements-3.txt
jdenisco3138d722018-09-24 14:59:33 -040027else
Dave Wallaced1706812021-08-12 18:36:02 -040028 [ -n "$(declare -f deactivate)" ] && deactivate
jdenisco3138d722018-09-24 14:59:33 -040029 source $VENV_DIR/bin/activate;
jdenisco65ed2d02018-11-06 12:32:33 -050030 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
jdenisco3138d722018-09-24 14:59:33 -040035 make -C $DOCS_DIR $1
36fi
37
38deactivate