From 7d3377e8f6be2ea40134a947032e2b807251f40f Mon Sep 17 00:00:00 2001 From: AlexV Date: Tue, 13 Aug 2024 11:47:32 +0700 Subject: [PATCH] feat: add sonarcube ci stage --- .gitlab-ci.yml | 21 +++++++++++++++++++++ sonar-project.properties | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 sonar-project.properties diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 21000eb..7f925ba 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,7 @@ image: stages: - sync - build + - test - upload - deploy @@ -134,3 +135,23 @@ github: - git fetch github $CI_COMMIT_REF_NAME - git branch -u github/$CI_COMMIT_REF_NAME - git push + +sonarqube-check: + image: + name: docker-proxy.cdek.ru/sonarsource/sonar-scanner-cli:latest + entrypoint: [""] + variables: + SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" + GIT_DEPTH: "0" + cache: + key: "${CI_JOB_NAME}" + paths: + - .sonar/cache + tags: + - docker + stage: test + script: + - sonar-scanner + allow_failure: true + only: + - main diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..43bb131 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectKey=cms_wordpress +sonar.qualitygate.wait=true