From 3a76111ed7451c59b60bdc5cf2804c41f7235fef Mon Sep 17 00:00:00 2001
From: Martin Weise <martin.weise@tuwien.ac.at>
Date: Sun, 21 Jan 2024 21:05:45 +0100
Subject: [PATCH] Updated the script

---
 .gitignore     |  1 +
 .gitlab-ci.yml | 10 ++++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4785a0ee84..a9807d11c0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@ schema.xsd
 .docs/.swagger/dist/
 .docs/.swagger/site/
 site/
+final/
 
 .$*
 
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2a6e39e0bb..67416ef608 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -500,6 +500,7 @@ build-api-latest:
     - apk add bash git
     - git fetch && git checkout master
     - bash .docs/.swagger/swagger-site.sh
+    - find ./site -type f -exec sed -i -e "s/\$TAG/latest/g" {} \;
     - mkdir -p ./swagger/latest
     - cp -r ./site/* ./swagger/latest/
   cache:
@@ -546,6 +547,7 @@ build-api-1.4:
     - apk add bash git maven
     - git fetch && git checkout release-v1.4
     - bash .docs/.swagger/swagger-site.sh
+    - find ./site -type f -exec sed -i -e "s/\$TAG/${VERSION}/g" {} \;
     - mkdir -p ./swagger/${VERSION}
     - cp -r ./site/* ./swagger/${VERSION}/
   cache:
@@ -594,9 +596,9 @@ docs-latest:
     - git fetch && git checkout master
     - pip install -r ./requirements.txt
     - mkdir -p ./final/{latest,1.3}
+    - find .docs -type f -exec sed -i -e "s/\$TAG/latest/g" {} \;
+    - find .docs -type f -exec sed -i -e "s/\$VERSION/latest/g" {} \;
     - mkdocs build && cp -r ./site ./final/latest
-    - find ./final/latest -type f -exec sed -i -e "s/\$TAG/latest/g" {} \;
-    - find ./final/latest -type f -exec sed -i -e "s/\$VERSION/latest/g" {} \;
     - cp ./.docs/redirect.html ./final/index.html
     - cp ./.docs/redirect.html ./final/1.3/index.html
     - cp -r ./swagger/latest ./final/latest/swagger
@@ -655,9 +657,9 @@ docs-1.4:
     - pip install -r ./.docs/requirements.txt
     - wget https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/.docs/overrides/main.html -O .docs/overrides/main.html -q
     - mkdir -p ./final
+    - find .docs -type f -exec sed -i -e "s/\$TAG/${VERSION}/g" {} \;
+    - find .docs -type f -exec sed -i -e "s/\$VERSION/${VERSION}/g" {} \;
     - mkdocs build && cp -r ./site ./final/${VERSION}
-    - find ./final/${VERSION} -type f -exec sed -i -e "s/\$TAG/${VERSION}/g" {} \;
-    - find ./final/${VERSION} -type f -exec sed -i -e "s/\$VERSION/${VERSION}/g" {} \;
     - cp -r ./swagger/${VERSION} ./final/${VERSION}/swagger
   cache:
     paths:
-- 
GitLab