Paul Vinciguerra | a26f544 | 2020-03-11 13:28:27 -0400 | [diff] [blame] | 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') |
Jon Loeliger | 3227e49 | 2020-12-07 10:57:46 -0500 | [diff] [blame] | 14 | OS_VERSION=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') |
Dave Wallace | d170681 | 2021-08-12 18:36:02 -0400 | [diff] [blame] | 15 | PIP_VERSION=$(grep 'PIP_VERSION=' $WS_ROOT/test/Makefile | cut -d'=' -f2) |
Dave Wallace | b93782b | 2021-08-17 15:11:43 -0400 | [diff] [blame] | 16 | PIP_TOOLS_VERSION=$(grep 'PIP_TOOLS_VERSION=' $WS_ROOT/test/Makefile | cut -d'=' -f2) |
jdenisco | 3138d72 | 2018-09-24 14:59:33 -0400 | [diff] [blame] | 17 | |
| 18 | if [ "$1" == "venv" ] |
| 19 | then |
Paul Vinciguerra | a26f544 | 2020-03-11 13:28:27 -0400 | [diff] [blame] | 20 | |
| 21 | # Install the virtual environment |
| 22 | $PYTHON_INTERP -m venv $VENV_DIR |
jdenisco | 3138d72 | 2018-09-24 14:59:33 -0400 | [diff] [blame] | 23 | source $VENV_DIR/bin/activate; |
Dave Wallace | d170681 | 2021-08-12 18:36:02 -0400 | [diff] [blame] | 24 | $PYTHON_INTERP -m pip install pip==$PIP_VERSION |
Dave Wallace | b93782b | 2021-08-17 15:11:43 -0400 | [diff] [blame] | 25 | $PYTHON_INTERP -m pip install pip-tools==$PIP_TOOLS_VERSION |
Dave Wallace | d170681 | 2021-08-12 18:36:02 -0400 | [diff] [blame] | 26 | $PYTHON_INTERP -m pip install -r $WS_ROOT/test/requirements-3.txt |
jdenisco | 3138d72 | 2018-09-24 14:59:33 -0400 | [diff] [blame] | 27 | else |
Dave Wallace | d170681 | 2021-08-12 18:36:02 -0400 | [diff] [blame] | 28 | [ -n "$(declare -f deactivate)" ] && deactivate |
jdenisco | 3138d72 | 2018-09-24 14:59:33 -0400 | [diff] [blame] | 29 | source $VENV_DIR/bin/activate; |
jdenisco | 65ed2d0 | 2018-11-06 12:32:33 -0500 | [diff] [blame] | 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 |
jdenisco | 3138d72 | 2018-09-24 14:59:33 -0400 | [diff] [blame] | 35 | make -C $DOCS_DIR $1 |
| 36 | fi |
| 37 | |
| 38 | deactivate |