blob: 61356bb1b8fad364e27edaab348565f31dde2041 [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')
jdenisco3138d722018-09-24 14:59:33 -040014
15if [ "$1" == "venv" ]
16then
Paul Vinciguerraa26f5442020-03-11 13:28:27 -040017 # We need to install the venv package on new systems
John DeNisco727c6532020-03-20 10:03:47 -040018 if [ "$OS_ID" == "ubuntu" ]
19 then
Paul Vinciguerraa26f5442020-03-11 13:28:27 -040020 sudo apt-get install $CONFIRM python3-venv
John DeNisco727c6532020-03-20 10:03:47 -040021 fi
22 if [ "$OS_ID" == "centos" ]
23 then
Paul Vinciguerraa26f5442020-03-11 13:28:27 -040024 sudo yum install $CONFIRM python3-venv
John DeNisco727c6532020-03-20 10:03:47 -040025 fi
Paul Vinciguerraa26f5442020-03-11 13:28:27 -040026
27 # Install the virtual environment
28 $PYTHON_INTERP -m venv $VENV_DIR
jdenisco3138d722018-09-24 14:59:33 -040029 source $VENV_DIR/bin/activate;
Paul Vinciguerraa26f5442020-03-11 13:28:27 -040030 $PYTHON_INTERP -m pip install wheel==0.34.2
31 $PYTHON_INTERP -m pip install -r $DOCS_DIR/etc/requirements.txt
jdenisco3138d722018-09-24 14:59:33 -040032else
33 source $VENV_DIR/bin/activate;
jdenisco65ed2d02018-11-06 12:32:33 -050034 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
jdenisco3138d722018-09-24 14:59:33 -040039 make -C $DOCS_DIR $1
40fi
41
42deactivate