blob: e4fb572df977e2da80c42e1fa88db34a961bdf42 [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)
jdenisco3138d722018-09-24 14:59:33 -040016
17if [ "$1" == "venv" ]
18then
Paul Vinciguerraa26f5442020-03-11 13:28:27 -040019
20 # Install the virtual environment
21 $PYTHON_INTERP -m venv $VENV_DIR
jdenisco3138d722018-09-24 14:59:33 -040022 source $VENV_DIR/bin/activate;
Dave Wallaced1706812021-08-12 18:36:02 -040023 $PYTHON_INTERP -m pip install pip==$PIP_VERSION
24 $PYTHON_INTERP -m pip install -r $WS_ROOT/test/requirements-3.txt
jdenisco3138d722018-09-24 14:59:33 -040025else
Dave Wallaced1706812021-08-12 18:36:02 -040026 [ -n "$(declare -f deactivate)" ] && deactivate
jdenisco3138d722018-09-24 14:59:33 -040027 source $VENV_DIR/bin/activate;
jdenisco65ed2d02018-11-06 12:32:33 -050028 VERSION=`source $WS_ROOT/src/scripts/version`
29 TM=`TZ=GMT date`
30 sed -ie "s/**VPP Version:\*\* .*/**VPP Version:** $VERSION/" $DOCS_DIR/about.rst
31 sed -ie "s/**Built on:\*\* .*/**Built on:** $TM/" $DOCS_DIR/about.rst
32 rm $DOCS_DIR/about.rste
jdenisco3138d722018-09-24 14:59:33 -040033 make -C $DOCS_DIR $1
34fi
35
36deactivate