diff --git a/NodeApp/.gitlab-ci/04_stageCodeQuality.yml b/NodeApp/.gitlab-ci/04_stageCodeQuality.yml index 34da3c81104d02864ec17037861763c402d4fcf2..5722bf9b006fb613f980a36b4d67c9dcb02bad3f 100644 --- a/NodeApp/.gitlab-ci/04_stageCodeQuality.yml +++ b/NodeApp/.gitlab-ci/04_stageCodeQuality.yml @@ -9,4 +9,26 @@ code_quality:lint: - npm install - npm run lint rules: - - if: '$CI_COMMIT_TAG =~ "/^$/"' \ No newline at end of file + - if: '$CI_COMMIT_TAG =~ "/^$/"' + +code_quality:sonarqube: + stage: code_quality + tags: + - code_quality + image: + name: leadrien/isc-sonar-scanner-cli + 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: + - merge_requests + - main + - develop diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000000000000000000000000000000000000..af4b65ccbb601c83d121e86bb7cee236b1f69948 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,3 @@ +sonar.projectKey=dojocli +sonar.qualitygate.wait=true +