diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c971ef4353847f189d84ec483d1bf7af3056a965..7f423f247e02f54e4786413d5128af08b50986ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,20 +10,23 @@ build-backend: # This job runs in the build stage, which runs first. stage: build image: maven:3.9.4-eclipse-temurin-21 script: - - "echo 'Starting Build Stage'" - - "cd ./sth-backend" - - "mvn compile" + - echo 'Starting Build Stage' + - cd ./sth-backend + - mvn compile test-backend: # This job runs in the test stage. stage: test # It only starts when the job in the build stage completes successfully. image: maven:3.9.4-eclipse-temurin-21 + before_script: + - apt-get update -qy + - apt-get install -y docker + - echo 'Starting Docker Container' + - docker compose up -d script: - - "echo 'Starting Docker Container'" - - "docker compose up -d" - - "echo 'Running unit tests...'" - - "cd ./sth-backend" - - "mvn test" + - echo 'Running unit tests...' + - cd ./sth-backend + - mvn test artifacts: reports: junit: @@ -34,9 +37,9 @@ package-backend: stage: package image: maven:3.9.4-eclipse-temurin-21 script: - - "echo 'Starting Package Stage'" - - "cd ./sth-backend" - - "mvn package" + - echo 'Starting Package Stage' + - cd ./sth-backend + - mvn package only: refs: - main