diff --git a/Makefile b/Makefile index e74bc4bd196c56652a551ff2baf5cb8173817278..8ad6b93fe3281a993d51d48b2f15038241297af8 100644 --- a/Makefile +++ b/Makefile @@ -231,14 +231,5 @@ teardown: build-api: bash .docs/.swagger/swagger-generate.sh -build-mkdocs: - bash .docs/build-website.sh - -build-sphinx: - pwd - ls -la . - ls la -la lib - ls la -la lib/python - bash ./lib/python/build-website.sh - -docs: build-mkdocs build-sphinx +docs: + bash ./build-docs.sh diff --git a/.docs/build-website.sh b/build-docs.sh similarity index 72% rename from .docs/build-website.sh rename to build-docs.sh index 6e2fb29e7959e6f65ed85f73e5e217c889db1ead..ffc17120b0e452732d8dde9688b75a07a23ad24d 100644 --- a/.docs/build-website.sh +++ b/build-docs.sh @@ -4,8 +4,25 @@ OVERRIDES_MAIN_HTML="" SCRIPTS_EXTRA_JS="" function clean_cache { - echo "Removing cache from directory ./site" - rm -rf ./site + echo "Removing cache from directory ./site ./lib/python/docs/build" + rm -rf ./site ./lib/python/docs/build +} + +function generate_sphinx { + BRANCH="release-$1" + echo "===================================================" + echo "Building LIB for version $1 on branch $BRANCH" + echo "===================================================" + git reset --hard && git checkout "$BRANCH" + pip install -r ./requirements.txt > /dev/null + mkdir -p ./final + if [ "$1" = "latest" ]; then + sed -i -e "s/__APPVERSION__/${APP_VERSION}/g" ./lib/python/setup.py ./lib/python/pyproject.toml ./lib/python/docs/conf.py ./lib/python/docs/index.rst ./lib/python/docs/index.rst + fi + sphinx-apidoc -o ./lib/python/docs/source ./lib/python/dbrepo + sphinx-build -M html ./lib/python/docs/ ./lib/python/docs/build/ + cp -r ./lib/python/docs/build/html "./final/$1/sphinx" + clean_cache } function generate_docs { @@ -66,6 +83,7 @@ git fetch generate_api "latest" generate_docs "latest" +generate_sphinx "latest" # versions for i in "${!versions[@]}"; do diff --git a/lib/python/build-website.sh b/lib/python/build-website.sh deleted file mode 100755 index 1178d90892335f55f21d414b7fe7519233bddbd2..0000000000000000000000000000000000000000 --- a/lib/python/build-website.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -python3 -m venv ./lib/python/venv -source ./lib/python/venv/bin/activate -PIPENV_PIPFILE=./lib/python/Pipfile pipenv install --dev -sed -i -e "s/__APPVERSION__/${APP_VERSION}/g" ./lib/python/pyproject.toml ./lib/python/setup.py ./lib/python/README.md ./lib/python/docs/conf.py ./lib/python/docs/index.rst -sphinx-apidoc -o ./lib/python/docs/source ./lib/python/dbrepo -sphinx-build -M html ./lib/python/docs/ ./lib/python/docs/build/ -cp -r ./lib/python/docs/build/html ./site/sphinx \ No newline at end of file