diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 80d804e66e077b6989c957f0d0be22520ea87a25..66b479718ed10400062d9182ca3b1b863fb0d7e9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -89,6 +89,26 @@ code_quality:lint: - npm run lint +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 + rules: + - if: '$CI_COMMIT_TAG =~ "/^$/"' + + test:build: stage: test image: node:latest diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000000000000000000000000000000000000..f59019dcd7ccddd7e84016a7e68ea001a8707bfc --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectKey=DojoBackendAPI +sonar.qualitygate.wait=true \ No newline at end of file