Skip to content
Snippets Groups Projects
Verified Commit f6b3117a authored by Martin Weise's avatar Martin Weise
Browse files

Updated the script

parent bd7f9369
No related branches found
No related tags found
No related merge requests found
...@@ -11,8 +11,6 @@ function generate_docs { ...@@ -11,8 +11,6 @@ function generate_docs {
git reset --hard && git checkout "$BRANCH" git reset --hard && git checkout "$BRANCH"
pip install -r ./requirements.txt > /dev/null pip install -r ./requirements.txt > /dev/null
mkdir -p ./final mkdir -p ./final
find .docs/ -type f -exec sed -i -e "s/__APPVERSION__/$1/g" {} \;
find .docs/ -type f -exec sed -i -e "s/__CHARTVERSION__/$1/g" {} \;
if [ "$1" = "latest" ]; then if [ "$1" = "latest" ]; then
OVERRIDES_MAIN_HTML=$(cat .docs/overrides/main.html) OVERRIDES_MAIN_HTML=$(cat .docs/overrides/main.html)
SCRIPTS_EXTRA_JS=$(cat .docs/scripts/extra.js) SCRIPTS_EXTRA_JS=$(cat .docs/scripts/extra.js)
...@@ -20,7 +18,10 @@ function generate_docs { ...@@ -20,7 +18,10 @@ function generate_docs {
echo $OVERRIDES_MAIN_HTML > .docs/overrides/main.html echo $OVERRIDES_MAIN_HTML > .docs/overrides/main.html
mkdir -p .docs/scripts mkdir -p .docs/scripts
echo $SCRIPTS_EXTRA_JS > .docs/scripts/extra.js echo $SCRIPTS_EXTRA_JS > .docs/scripts/extra.js
sed -i -e "s/__APPVERSION__/${APP_VERSION}/g" .docs/scripts/extra.js
fi 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" mkdocs build > /dev/null && cp -r ./site "./final/$1"
cp -r "./swagger/$1" "./final/$1/swagger" cp -r "./swagger/$1" "./final/$1/swagger"
} }
......
function getVersion() { function getVersion() {
const segments = location.pathname.split('/'); const segments = location.pathname.split('/');
if (segments.length >= 4) { if (segments.length > 4) {
console.log('version', segments[3])
return segments[3]; return segments[3];
} else { } else {
console.log('default version __APPVERSION__')
return '__APPVERSION__'; return '__APPVERSION__';
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment