Sans pipeline :
Avec pipeline :
CI/CD = ceinture de sécurité.
image: maven:3.9-eclipse-temurin-17 stages: [build, test] build: stage: build script: - mvn -q -DskipTests compile test: stage: test script: - mvn -q test
Explication :
mvn test
test: stage: test script: - mvn test artifacts: when: always reports: junit: target/surefire-reports/*.xml
But : voir les tests dans l’UI GitLab.
Vous voulez mesurer si vous testez “un peu” ou “sérieusement”.
Version simple (concept) :
docker-build: stage: build image: docker:24 services: [docker:dind] script: - docker build -t wouaf-api .
Dans un job, on peut :
/actuator/health
Exemple (simplifié) :
curl -f http://localhost:8080/actuator/health || exit 1
Le -f fait échouer curl si status >= 400.
-f
mvn package