sonarqube
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
|
- build-sonar
|
||||||
- docker
|
- docker
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
@@ -9,6 +10,8 @@ variables:
|
|||||||
DOCKER_IMAGE_LATEST: ${CI_REGISTRY_IMAGE}:latest
|
DOCKER_IMAGE_LATEST: ${CI_REGISTRY_IMAGE}:latest
|
||||||
DOCKER_DRIVER: overlay2
|
DOCKER_DRIVER: overlay2
|
||||||
DOCKER_TLS_CERTDIR: ""
|
DOCKER_TLS_CERTDIR: ""
|
||||||
|
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"
|
||||||
|
GIT_DEPTH: "0"
|
||||||
|
|
||||||
# Build stage - compile Java and frontend
|
# Build stage - compile Java and frontend
|
||||||
build:java:
|
build:java:
|
||||||
@@ -85,6 +88,23 @@ test:quality:
|
|||||||
only:
|
only:
|
||||||
- merge_requests
|
- merge_requests
|
||||||
|
|
||||||
|
build-sonar:
|
||||||
|
stage: build-sonar
|
||||||
|
image: gradle:8.10.0-jdk17-jammy
|
||||||
|
cache:
|
||||||
|
policy: pull-push
|
||||||
|
key: "sonar-cache-$CI_COMMIT_REF_SLUG"
|
||||||
|
paths:
|
||||||
|
- "${SONAR_USER_HOME}/cache"
|
||||||
|
- sonar-scanner/
|
||||||
|
script: gradle sonar
|
||||||
|
allow_failure: true
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
||||||
|
- if: $CI_COMMIT_BRANCH == 'master'
|
||||||
|
- if: $CI_COMMIT_BRANCH == 'main'
|
||||||
|
- if: $CI_COMMIT_BRANCH == 'develop'
|
||||||
|
|
||||||
# Docker build and push
|
# Docker build and push
|
||||||
docker:build:
|
docker:build:
|
||||||
stage: docker
|
stage: docker
|
||||||
|
|||||||
@@ -6,6 +6,15 @@ plugins {
|
|||||||
id("java")
|
id("java")
|
||||||
id("org.springframework.boot") version "3.2.5" apply false
|
id("org.springframework.boot") version "3.2.5" apply false
|
||||||
id("io.spring.dependency-management") version "1.1.4"
|
id("io.spring.dependency-management") version "1.1.4"
|
||||||
|
id("org.sonarqube") version "7.2.3.7755"
|
||||||
|
}
|
||||||
|
|
||||||
|
sonar {
|
||||||
|
properties {
|
||||||
|
property("sonar.projectKey", "MTGSearch")
|
||||||
|
property("sonar.projectName", "MTGSearch")
|
||||||
|
property("sonar.qualitygate.wait", true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "net.moustos"
|
group = "net.moustos"
|
||||||
|
|||||||
Reference in New Issue
Block a user