summaryrefslogtreecommitdiff
path: root/pse-server/.gitlab-ci.yml
diff options
context:
space:
mode:
authorOrangerot <purple@orangerot.dev>2024-06-19 00:14:49 +0200
committerOrangerot <purple@orangerot.dev>2024-06-27 12:11:14 +0200
commit5b8851b6c268d0e93c158908fbfae9f8473db5ff (patch)
tree7010eb85d86fa2da06ea4ffbcdb01a685d502ae8 /pse-server/.gitlab-ci.yml
Initial commitHEADmain
Diffstat (limited to 'pse-server/.gitlab-ci.yml')
-rw-r--r--pse-server/.gitlab-ci.yml56
1 files changed, 56 insertions, 0 deletions
diff --git a/pse-server/.gitlab-ci.yml b/pse-server/.gitlab-ci.yml
new file mode 100644
index 0000000..9404844
--- /dev/null
+++ b/pse-server/.gitlab-ci.yml
@@ -0,0 +1,56 @@
+# https://about.gitlab.com/blog/2016/12/14/continuous-delivery-of-a-spring-boot-application-with-gitlab-ci-and-kubernetes/
+
+services:
+ - mariadb:latest
+
+variables:
+ MYSQL_DATABASE: "demo"
+ MYSQL_ROOT_PASSWORD: "dbpass"
+ MYSQL_USER: "pse"
+ MYSQL_PASSWORD: "PSEsq1702!mdb"
+ SPRING_DATASOURCE_URL: "jdbc:mariadb://mariadb:3306/demo"
+
+stages:
+ - deploy
+ - build
+ - test
+ # - package
+
+checkstyle:
+ image: maven:3.8-eclipse-temurin-17-alpine
+ stage: test
+ script:
+ - "mvn checkstyle:check"
+ allow_failure: true
+
+spring-test:
+ image: maven:3.8-eclipse-temurin-17-alpine
+ stage: test
+ script:
+ - "apk update && apk add mysql-client"
+ - "mvn test"
+
+pages:
+ image: maven:3.8-eclipse-temurin-17-alpine
+ script:
+ - "apk update && apk add mysql-client"
+ - "mkdir -p public/{checkstyle,surefire}"
+ - "mvn checkstyle:checkstyle"
+ - "mv target/site/* public/checkstyle"
+ - "mvn surefire-report:report"
+ - "mv target/site/* public/surefire"
+ artifacts:
+ paths:
+ - public
+ rules:
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
+
+# https://stackoverflow.com/questions/37403120/gitlab-ci-docker-executor-how-to-setup-mysql-service
+maven-build:
+ image: maven:3.8-eclipse-temurin-17-alpine
+ stage: build
+ script:
+ - "mvn package -B -DskipTests"
+ artifacts:
+ paths:
+ - target/*.jar