sonarqube

This commit is contained in:
2026-04-27 23:35:34 +09:30
parent 648d67cb29
commit 28022c3210
2 changed files with 29 additions and 0 deletions
+20
View File
@@ -1,6 +1,7 @@
stages:
- build
- test
- build-sonar
- docker
- deploy
@@ -9,6 +10,8 @@ variables:
DOCKER_IMAGE_LATEST: ${CI_REGISTRY_IMAGE}:latest
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"
GIT_DEPTH: "0"
# Build stage - compile Java and frontend
build:java:
@@ -85,6 +88,23 @@ test:quality:
only:
- 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:
stage: docker
+9
View File
@@ -6,6 +6,15 @@ plugins {
id("java")
id("org.springframework.boot") version "3.2.5" apply false
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"