diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fbcc4a5..3f0822b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,6 +18,8 @@ stages: - lint - build - test + - sonarqube-check + - sonarqube-vulnerability-report - oci-build - deploy - deploy-dev # New stage for development deployment @@ -88,6 +90,28 @@ build-ical: - data-manager/go.sum - data-manager/go.mod +sonarqube-data-manager: + stage: sonarqube-check + image: + name: sonarsource/sonar-scanner-cli:5.0 + entrypoint: [""] + variables: + SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache + GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task + cache: + key: "${CI_JOB_NAME}" + paths: + - .sonar/cache + script: + - cd services/data-manager + - sonar-scanner + allow_failure: true + only: + - merge_requests + - master + - main + - develop + build-frontend: image: node:lts stage: build diff --git a/services/data-manager/sonar-project.properties b/services/data-manager/sonar-project.properties new file mode 100644 index 0000000..a0ad568 --- /dev/null +++ b/services/data-manager/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectKey=HTWKalender +sonar.qualitygate.wait=true