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') |
jdenisco | 3138d72 | 2018-09-24 14:59:33 -0400 | [diff] [blame] | 14 | |
| 15 | if [ "$1" == "venv" ] |
| 16 | then |
Paul Vinciguerra | a26f544 | 2020-03-11 13:28:27 -0400 | [diff] [blame] | 17 | # We need to install the venv package on new systems |
John DeNisco | 727c653 | 2020-03-20 10:03:47 -0400 | [diff] [blame] | 18 | if [ "$OS_ID" == "ubuntu" ] |
| 19 | then |
Paul Vinciguerra | a26f544 | 2020-03-11 13:28:27 -0400 | [diff] [blame] | 20 | sudo apt-get install $CONFIRM python3-venv |
John DeNisco | 727c653 | 2020-03-20 10:03:47 -0400 | [diff] [blame] | 21 | fi |
| 22 | if [ "$OS_ID" == "centos" ] |
| 23 | then |
Paul Vinciguerra | a26f544 | 2020-03-11 13:28:27 -0400 | [diff] [blame] | 24 | sudo yum install $CONFIRM python3-venv |
John DeNisco | 727c653 | 2020-03-20 10:03:47 -0400 | [diff] [blame] | 25 | fi |
Paul Vinciguerra | a26f544 | 2020-03-11 13:28:27 -0400 | [diff] [blame] | 26 | |
| 27 | # Install the virtual environment |
| 28 | $PYTHON_INTERP -m venv $VENV_DIR |
jdenisco | 3138d72 | 2018-09-24 14:59:33 -0400 | [diff] [blame] | 29 | source $VENV_DIR/bin/activate; |
Paul Vinciguerra | a26f544 | 2020-03-11 13:28:27 -0400 | [diff] [blame] | 30 | $PYTHON_INTERP -m pip install wheel==0.34.2 |
| 31 | $PYTHON_INTERP -m pip install -r $DOCS_DIR/etc/requirements.txt |
jdenisco | 3138d72 | 2018-09-24 14:59:33 -0400 | [diff] [blame] | 32 | else |
| 33 | source $VENV_DIR/bin/activate; |
jdenisco | 65ed2d0 | 2018-11-06 12:32:33 -0500 | [diff] [blame] | 34 | VERSION=`source $WS_ROOT/src/scripts/version` |
| 35 | TM=`TZ=GMT date` |
| 36 | sed -ie "s/**VPP Version:\*\* .*/**VPP Version:** $VERSION/" $DOCS_DIR/about.rst |
| 37 | sed -ie "s/**Built on:\*\* .*/**Built on:** $TM/" $DOCS_DIR/about.rst |
| 38 | rm $DOCS_DIR/about.rste |
jdenisco | 3138d72 | 2018-09-24 14:59:33 -0400 | [diff] [blame] | 39 | make -C $DOCS_DIR $1 |
| 40 | fi |
| 41 | |
| 42 | deactivate |