From 5b8851b6c268d0e93c158908fbfae9f8473db5ff Mon Sep 17 00:00:00 2001 From: Orangerot Date: Wed, 19 Jun 2024 00:14:49 +0200 Subject: Initial commit --- pse-server/.gitlab-ci.yml | 56 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 pse-server/.gitlab-ci.yml (limited to 'pse-server/.gitlab-ci.yml') 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 -- cgit v1.2.3