From 60975992dd9116cc1015989210b37917d02d95f5 Mon Sep 17 00:00:00 2001
From: Mathieu Courtois <mathieu.courtois@edf.fr>
Date: Tue, 4 Feb 2025 17:55:26 +0100
Subject: [PATCH] [#34400] init sonarqube config

---
 .gitlabci/gitlab-ci-pleiade.yml | 18 ++++++++++++++++++
 sonar-project.properties        |  3 +++
 2 files changed, 21 insertions(+)
 create mode 100644 sonar-project.properties

diff --git a/.gitlabci/gitlab-ci-pleiade.yml b/.gitlabci/gitlab-ci-pleiade.yml
index 37a4b88..9e12728 100644
--- a/.gitlabci/gitlab-ci-pleiade.yml
+++ b/.gitlabci/gitlab-ci-pleiade.yml
@@ -47,3 +47,21 @@ auto_install:
   needs: ["prepare", "unittests"]
   script:
     - .gitlabci/test_auto_install.sh
+
+sonarqube-check:
+  stage: test
+  image:
+    name: sonarsource/sonar-scanner-cli:latest
+    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:
+    - sonar-scanner
+  allow_failure: true
+  # only:
+  #   - main
diff --git a/sonar-project.properties b/sonar-project.properties
new file mode 100644
index 0000000..604dd11
--- /dev/null
+++ b/sonar-project.properties
@@ -0,0 +1,3 @@
+sonar.projectKey=codeaster_devtools_AZTR4LwB2JThbS9_YjfM
+sonar.qualitygate.wait=true
+
-- 
GitLab