From b22d81704a2c695375f4eaa0c90db6e983597a9a Mon Sep 17 00:00:00 2001
From: Hannah Holzheu <hh062@hdm-stuttgart.de>
Date: Mon, 15 Jan 2024 19:16:40 +0100
Subject: [PATCH] added package stage for CI/CD

---
 .gitlab-ci.yml | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b6be142..6d3f61a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,11 +5,14 @@ cache:
 stages:
   - build
   - test
+  - package
 
 maven-build:
   image: maven:3.8.5-openjdk-17
   stage: build
-  script: "mvn clean package -DskipTests"
+  script:
+    - "echo 'Starting Build Process'"
+    - "mvn compile"
   artifacts:
     paths:
       - target/
@@ -20,3 +23,25 @@ maven-test:
   script: "mvn test"
   dependencies:
     - maven-build
+  artifacts:
+    reports:
+      junit:
+        - target/surefire-reports/TEST-*.xml
+        - target/failsafe-reports/TEST-*.xml
+
+
+maven-package:
+  stage: package
+  image: maven:3.8.5-openjdk-17
+  script:
+    - "echo 'Starting Package Stage'"
+    - "mvn package -DSkipTests"
+  only:
+    refs:
+      - main
+  artifacts:
+    paths:
+      - target/*.jar
+    expire_in: 2 days
+
+
-- 
GitLab