From da71564beb094b09042cb2bc2170f843cee51a51 Mon Sep 17 00:00:00 2001
From: Andreas <andreksv@ntnu.no>
Date: Thu, 18 Apr 2024 08:18:27 +0200
Subject: [PATCH] test/Update update_html.py and application.yaml

---
 .gitlab-ci.yml                      | 16 +++++-----------
 src/main/resources/application.yaml |  2 +-
 2 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d6cdcc9..7de05c2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,22 +2,16 @@ image: maven:3.8.5-openjdk-17
 
 variables:
   # This will suppress any download for dependencies and plugins or upload messages which would clutter the console log.
-  # `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
   MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
   MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
   SPRING_PROFILES_ACTIVE: gitlab-ci 
 
-  # Configure mysql environment variables (https://hub.docker.com/_/mysql/)
-  MYSQL_DATABASE: $MYSQL_DATABASE
-  MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD   
-  Host: mysql
-  User: root
-  Password: root
-  Database: sparesti 
-
-
 services:
-  - mysql:latest
+  - name: mysql:latest
+    alias: mysql
+    variables:
+      MYSQL_ROOT_PASSWORD: "root"  # TODO Set this in GitLab's CI/CD environment variables for security in production
+      MYSQL_DATABASE: "sparesti"
   
 stages:
   - compile_and_test
diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml
index 8e139a5..ed8ec32 100644
--- a/src/main/resources/application.yaml
+++ b/src/main/resources/application.yaml
@@ -2,7 +2,7 @@ server.port: 8080
 
 spring:
   datasource:
-    url: jdbc:mysql://localhost:3306/sparesti
+    url: jdbc:mysql://mysql:3306/sparesti
     username: root
     password: root
   jpa:
-- 
GitLab