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

Debug

parent b1a65d1b
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
INDEX_HTML=""
OVERRIDES_MAIN_HTML=""
SCRIPTS_EXTRA_JS=""
......@@ -15,7 +14,6 @@ function generate_docs {
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
INDEX_HTML=$(cat .docs/redirect.html)
OVERRIDES_MAIN_HTML=$(cat .docs/overrides/main.html)
SCRIPTS_EXTRA_JS=$(cat .docs/scripts/extra.js)
else
......@@ -71,8 +69,6 @@ done
# finalization
echo "==================================================="
echo "Adding index.html from branch release-latest"
echo $INDEX_HTML > .docs/redirect.html
sed -i -e "s/__APPVERSION__/${APP_VERSION}/g" .docs/redirect.html
cp ./.docs/redirect.html ./final/index.html
echo "Moving default version $APP_VERSION docs to /"
cp -r ./final/${APP_VERSION}/* ./final/
echo "==================================================="
......@@ -5,7 +5,7 @@
<head>
<meta charset="UTF-8">
<title>Redirect Notice</title>
<meta http-equiv="Refresh" content="10; url='//localhost:8000/infrastructures/dbrepo/__APPVERSION__/'" />
<meta http-equiv="Refresh" content="0; url='/infrastructures/dbrepo/__APPVERSION__/'" />
</head>
<body>
<h1>Redirect Notice</h1>
......@@ -14,7 +14,7 @@
available at:
</p>
<p>
<a href="//localhost:8000/infrastructures/dbrepo/__APPVERSION__/">//localhost:8000/infrastructures/dbrepo/__APPVERSION__/</a>
<a href="/infrastructures/dbrepo/__APPVERSION__/">/infrastructures/dbrepo/__APPVERSION__/</a>
</p>
</body>
</html>
\ No newline at end of file
function getVersion() {
const segments = location.pathname.split('/');
if (segments.length >= 4) {
console.log('version', segments[3])
return segments[3];
} else {
console.log('default version __APPVERSION__')
return '__APPVERSION__';
}
}
......
......@@ -17,4 +17,4 @@ FROM nginx as runtime
WORKDIR /usr/share/nginx/html/infrastructures/dbrepo/
COPY --from=build /app/final /usr/share/nginx/html/infrastructures/dbrepo/
COPY --from=build /app/final /usr/share/nginx/html/infrastructures/dbrepo/
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment