From c78443cb744c77ca3cfdcb2e25529492b959656f Mon Sep 17 00:00:00 2001 From: Martin Weise <martin.weise@tuwien.ac.at> Date: Thu, 11 Apr 2024 08:22:47 +0200 Subject: [PATCH] Use the central versions script --- build-docs.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/build-docs.sh b/build-docs.sh index 15a81eb54c..a38121fceb 100644 --- a/build-docs.sh +++ b/build-docs.sh @@ -1,7 +1,6 @@ #!/bin/bash -OVERRIDES_MAIN_HTML="" -SCRIPTS_EXTRA_JS="" +VERSIONS_JSON="" function clean_cache { echo "Removing cache from directory ./site ./lib/python/docs/build" @@ -32,18 +31,13 @@ function generate_docs { pip install -r ./requirements.txt > /dev/null mkdir -p ./final if [ "$1" = "latest" ]; then - OVERRIDES_MAIN_HTML=$(cat .docs/overrides/main.html) - sed -i -e "s/__APPVERSION__/${APP_VERSION}/g" .docs/scripts/extra.js - SCRIPTS_EXTRA_JS=$(cat .docs/scripts/extra.js) - else - echo $OVERRIDES_MAIN_HTML > .docs/overrides/main.html - mkdir -p .docs/scripts - echo $SCRIPTS_EXTRA_JS > .docs/scripts/extra.js + VERSIONS_JSON=$(cat ./versions.json) fi find .docs/ -type f -exec sed -i -e "s/__APPVERSION__/$1/g" {} \; find .docs/ -type f -exec sed -i -e "s/__CHARTVERSION__/$1/g" {} \; mkdocs build > /dev/null && cp -r ./site "./final/$1" cp -r "./swagger/$1" "./final/$1/swagger" + echo $VERSIONS_JSON > "./final/$1/versions.json" clean_cache } -- GitLab