From eb5584b5c961edf650424bc679cecdc9a7d9b49a Mon Sep 17 00:00:00 2001 From: DeveloperDurp Date: Sun, 21 May 2023 06:32:32 -0500 Subject: [PATCH] sonarqube --- .gitlab-ci.yml | 18 +++++++++++++++++- sonar-project.properties | 4 ++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 sonar-project.properties diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9e95961..1e499b1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,4 +4,20 @@ include: file: 'pipelines/build-container.yml' variables: - GIN_MODE: release \ No newline at end of file + GIN_MODE: release + 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 + +sonarcloud-check: + stage: .pre + image: + name: sonarsource/sonar-scanner-cli:latest + entrypoint: [""] + cache: + key: "${CI_JOB_NAME}" + paths: + - .sonar/cache + script: + - sonar-scanner + rules: + - if: $CI_COMMIT_REF_NAME == 'main' || $CI_PIPELINE_SOURCE == 'merge_request_event' \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..51ea01c --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,4 @@ +sonar.projectKey=DeveloperDurp_DurpAPI +sonar.organization=developerdurp +sonar.sources=. +sonar.host.url=https://sonarcloud.io \ No newline at end of file