From be501299ed9d5e8ca7e211bdf329c4b24db3b0ff Mon Sep 17 00:00:00 2001
From: Martin Weise <martin.weise@tuwien.ac.at>
Date: Sat, 15 Jun 2024 22:11:45 +0200
Subject: [PATCH] Removed metadata db

---
 .docs/api/metadata-db.md | 11 +++++++++--
 .gitlab-ci.yml           | 20 --------------------
 make/rel.mk              |  2 --
 3 files changed, 9 insertions(+), 24 deletions(-)

diff --git a/.docs/api/metadata-db.md b/.docs/api/metadata-db.md
index f5cc4d84cc..4336c7666c 100644
--- a/.docs/api/metadata-db.md
+++ b/.docs/api/metadata-db.md
@@ -14,8 +14,8 @@ author: Martin Weise
 The metadata database is the single, central source of truth within DBRepo and holds all metadata information for
 interaction between the services and displaying information in the UI.
 
-On the first start, the schema is generated by the file `/docker-entrypoint-initdb.d/setup-schema.sql` within the 
-container. You can add custom files that should be executed on the first start by placing them into the 
+On the first start, the schema is generated by the file `/docker-entrypoint-initdb.d/setup-schema.sql` within the
+container. You can add custom files that should be executed on the first start by placing them into the
 `/docker-entrypoint-initdb.d/` folder as well. For example:
 
 ```yaml
@@ -28,6 +28,13 @@ services:
     ...
 ```
 
+## Image
+
+:octicons-tag-16:{ title="Minimum version" } 1.4.4
+
+We recommend to use the MariaDB image directly instead of our own maintained image which just copied
+the `setup-schema.sql` into the container. This can be done more transparently through volume mounts.
+
 !!! warning "Alphabetic Filename Sorting"
 
     Beware that the init script provided by Bitnami executes files in alphabetic order! For example: the file 
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7c0e08eb15..c74b4cabac 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -459,26 +459,6 @@ scan-data-db:
     reports:
       container_scanning: ./.trivy/trivy-data-db-report.json
 
-scan-metadata-db:
-  image: bitnami/trivy:latest
-  stage: scan
-  only:
-    refs:
-      - master
-  allow_failure: true
-  script:
-    - trivy image --insecure --exit-code 0 --format template --template "@.gitlab/gitlab.tpl" -o ./.trivy/trivy-metadata-db-report.json dbrepo-metadata-db:latest
-    - trivy image --insecure --exit-code 0 dbrepo-metadata-db:latest
-    - trivy image --insecure --exit-code 1 --severity CRITICAL dbrepo-metadata-db:latest
-  cache:
-    paths:
-      - .trivycache/
-  artifacts:
-    when: always
-    expire_in: 1 days
-    reports:
-      container_scanning: ./.trivy/trivy-metadata-db-report.json
-
 scan-ui:
   image: bitnami/trivy:latest
   stage: scan
diff --git a/make/rel.mk b/make/rel.mk
index c06bb23433..97aeca4e16 100644
--- a/make/rel.mk
+++ b/make/rel.mk
@@ -4,7 +4,6 @@
 tag-images: build-images ## Tag the docker images.
 	docker tag dbrepo-analyse-service:latest "${REPOSITORY_URL}/analyse-service:${APP_VERSION}"
 	docker tag dbrepo-auth-service:latest "${REPOSITORY_URL}/auth-service:${APP_VERSION}"
-	docker tag dbrepo-metadata-db:latest "${REPOSITORY_URL}/metadata-db:${APP_VERSION}"
 	docker tag dbrepo-ui:latest "${REPOSITORY_URL}/ui:${APP_VERSION}"
 	docker tag dbrepo-data-service:latest "${REPOSITORY_URL}/data-service:${APP_VERSION}"
 	docker tag dbrepo-metadata-service:latest "${REPOSITORY_URL}/metadata-service:${APP_VERSION}"
@@ -18,7 +17,6 @@ tag-images: build-images ## Tag the docker images.
 release-images: tag-images ## Release the docker images.
 	docker push "${REPOSITORY_URL}/analyse-service:${APP_VERSION}"
 	docker push "${REPOSITORY_URL}/auth-service:${APP_VERSION}"
-	docker push "${REPOSITORY_URL}/metadata-db:${APP_VERSION}"
 	docker push "${REPOSITORY_URL}/ui:${APP_VERSION}"
 	docker push "${REPOSITORY_URL}/data-service:${APP_VERSION}"
 	docker push "${REPOSITORY_URL}/search-db:${APP_VERSION}"
-- 
GitLab