Commit 4374083b authored by Raphaël Flores's avatar Raphaël Flores
Browse files

Merge branch 'feat/activate_branch_analysis_in_sonarqube' into 'master'

Activate branch analysis in Sonarqube and MR decoration in Gitlab

See merge request !65
parents bdd0f00e ea25c6e1
......@@ -269,3 +269,4 @@ gradle-app.setting
**/build/
# End of https://www.gitignore.io/api/gradle,eclipse,intellij,visualstudiocode,kotlin,git,macos,linux
frontend/package-lock.json
......@@ -19,6 +19,7 @@ variables:
GRADLE_USER_HOME: $CI_PROJECT_DIR/.gradle
APP_NAME: faidare
JAR_PATH: "backend/build/libs/${APP_NAME}.jar"
GIT_DEPTH: 0
# Gradle cache for all jobs
......@@ -61,17 +62,29 @@ test-and-sonarqube:
command: ["bin/elasticsearch", "-Ediscovery.type=single-node"]
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=true"
SONAR_BRANCH_OPTS: "-Dsonar.pullrequest.key=$CI_MERGE_REQUEST_ID -Dsonar.pullrequest.branch=$CI_COMMIT_REF_NAME"
script:
- ./gradlew :frontend:test --parallel
- ./gradlew :backend:test --parallel
- find /tmp/node/*/bin -name node -exec ln -s {} /tmp/node/node \;
- export PATH="/tmp/node/:$PATH"
- ./gradlew sonarqube -x test
- ./gradlew sonarqube -x test $SONAR_BRANCH_OPTS
artifacts:
reports:
junit:
- ./backend/build/test-results/test/TEST-*.xml
- ./frontend/karma-junit-tests-report/TEST*.xml
only:
- merge_requests
test-and-sonarqube-master:
extends: test-and-sonarqube
variables:
SONAR_BRANCH_OPTS: ""
only:
refs:
- master
# BUILD
......
......@@ -61,7 +61,6 @@
"karma-jasmine": "3.1.1",
"karma-jasmine-html-reporter": "1.5.3",
"karma-junit-reporter": "2.0.1",
"ngx-speculoos": "3.0.0",
"ngx-speculoos": "1.1.0",
"protractor": "5.4.1",
"ts-node": "7.0.1",
......
# gradle.properties
systemProp.sonar.host.url=https://urgi.versailles.inrae.fr/sonarqube
#----- Token generated from an account with 'publish analysis' permission
systemProp.sonar.login=94f359749d72f13d1e1a407521a8dd57c71ba562
systemProp.sonar.sources=frontend/src
systemProp.sonar.language=typescript
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment