diff --git a/.docs/redirect.html b/.docs/index.html.tpl similarity index 58% rename from .docs/redirect.html rename to .docs/index.html.tpl index 69ede955cdfbee7f47d4abb431aec9b3b315b348..d92d7c4b18e9b7f375ce12fa8de62407030bc9f3 100644 --- a/.docs/redirect.html +++ b/.docs/index.html.tpl @@ -1,20 +1,18 @@ <!DOCTYPE html> <html lang="en"> -<!-- This file exists only once - in the final documentation --> <head> <meta charset="UTF-8"> <title>Redirect Notice</title> - <meta http-equiv="Refresh" content="0; url='/infrastructures/dbrepo/1.5/'" /> + <meta http-equiv="Refresh" content="0; url='/infrastructures/dbrepo/${DOC_VERSION}/'" /> </head> <body> <h1>Redirect Notice</h1> <p> - This page should automatically open the documentation for version <code>1.5</code>. In case this page does not load the site is + This page should automatically open the documentation for version <code>${DOC_VERSION}</code>. In case this page does not load the site is available at: </p> <p> - <a href="/infrastructures/dbrepo/1.5/">/infrastructures/dbrepo/1.5/</a> + <a href="/infrastructures/dbrepo/${DOC_VERSION}/">/infrastructures/dbrepo/${DOC_VERSION}/</a> </p> </body> </html> \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ce79f1a01fe461b5f290625725cf8350bc6a94b1..889a1560f678fe47765d70c7849b7a578f19091f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -443,6 +443,7 @@ release-docs: - "cp -r ./site/* ./final/${DOC_VERSION}" # mkdocs - "cp .docker/dist.tar.gz ./final/${APP_VERSION}/dist.tar.gz" # dist - "cp .docs/redirect.html ./final/${APP_VERSION}/index.html" # redirect patch docs + - sed -i "s/\${DOC_VERSION}/${DOC_VERSION}/g" index.html - "bash ./.gitlab/gen-badge.sh" - eval $(ssh-agent -s) - "mkdir -p /root/.ssh" @@ -452,7 +453,7 @@ release-docs: - tar czf ./final.tar.gz ./final - "scp -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa final.tar.gz $CI_DOC_USER@$CI_DOC_IP:final.tar.gz" - "scp -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa versions.json $CI_DOC_USER@$CI_DOC_IP:/system/user/ifs/infrastructures/public_html/dbrepo/versions.json" - - "scp -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa .docs/redirect.html $CI_DOC_USER@$CI_DOC_IP:/system/user/ifs/infrastructures/public_html/dbrepo/index.html" + - "scp -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa .docs/index.html.tpl $CI_DOC_USER@$CI_DOC_IP:/system/user/ifs/infrastructures/public_html/dbrepo/index.html" - 'ssh -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa $CI_DOC_USER@$CI_DOC_IP "rm -rf /system/user/ifs/infrastructures/public_html/dbrepo/${DOC_VERSION}; tar xzf ./final.tar.gz; rm -f ./final.tar.gz; cp -r ./final/* /system/user/ifs/infrastructures/public_html/dbrepo; rm -rf ./final"' release-libs: diff --git a/build-docs.sh b/build-docs.sh index fba2afc76609716172f53c8bb0125c579a99d8d9..8639b3756fe3996935a3feb62884a4bfa3bcdd84 100644 --- a/build-docs.sh +++ b/build-docs.sh @@ -89,6 +89,6 @@ done # finalization echo "===================================================" echo "Moving HTML redirect and JSON versions to /" -cp ./final/${APP_VERSION}/redirect.html ./final/index.html +cp ./final/${APP_VERSION}/index.html.tpl ./final/index.html cp ./final/${APP_VERSION}/versions.json ./final/versions.json echo "==================================================="