From 4fe0c58e7554d7f5b8d6692f49357bc8f1e3c4a6 Mon Sep 17 00:00:00 2001
From: Martin Weise <martin.weise@tuwien.ac.at>
Date: Mon, 10 Jun 2024 10:19:55 +0200
Subject: [PATCH] Fixed the dir deletion and redirect

---
 .docs/redirect.html | 6 +++---
 .gitlab-ci.yml      | 4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/.docs/redirect.html b/.docs/redirect.html
index a3737a67b6..dd85a970b2 100644
--- a/.docs/redirect.html
+++ b/.docs/redirect.html
@@ -5,16 +5,16 @@
 <head>
     <meta charset="UTF-8">
     <title>Redirect Notice</title>
-    <meta http-equiv="Refresh" content="0; url='/infrastructures/dbrepo/__APPVERSION__/'" />
+    <meta http-equiv="Refresh" content="0; url='/infrastructures/dbrepo/1.4.4/'" />
 </head>
 <body>
 <h1>Redirect Notice</h1>
 <p>
-    This page should automatically open the documentation for version <code>__APPVERSION__</code>. In case this page does not load the site is
+    This page should automatically open the documentation for version <code>1.4.4</code>. In case this page does not load the site is
     available at:
 </p>
 <p>
-    <a href="/infrastructures/dbrepo/__APPVERSION__/">/infrastructures/dbrepo/__APPVERSION__/</a>
+    <a href="/infrastructures/dbrepo/1.4.4/">/infrastructures/dbrepo/1.4.4/</a>
 </p>
 </body>
 </html>
\ No newline at end of file
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index fb8052ad85..813ca707d1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -631,7 +631,9 @@ release-docs:
     - echo "$CI_DOC_ID" > ~/.ssh/known_hosts
     - 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"
-    - "ssh -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa $CI_DOC_USER@$CI_DOC_IP 'rm -rf /system/user/ifs/infrastructures/public_html/dbrepo/*; tar xzf ./final.tar.gz; rm -f ./final.tar.gz; cp -r ./final/* /system/user/ifs/infrastructures/public_html/dbrepo/${APP_VERSION}; rm -rf ./final'"
+    - "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"
+    - "ssh -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa $CI_DOC_USER@$CI_DOC_IP 'rm -rf /system/user/ifs/infrastructures/public_html/dbrepo/${APP_VERSION}; tar xzf ./final.tar.gz; rm -f ./final.tar.gz; cp -r ./final/* /system/user/ifs/infrastructures/public_html/dbrepo/${APP_VERSION}; rm -rf ./final'"
 
 release-libs:
   stage: release
-- 
GitLab