Commit 31436485 authored by Klaus-Dieter Quibeldey-Cirkel's avatar Klaus-Dieter Quibeldey-Cirkel
Browse files

Merge branch '212-use-sonarqube-for-static-code-analysis' into 'staging'

212 use sonarqube for static code analysis

See merge request !46
parents ba3b205a ce12fe99
......@@ -3,6 +3,7 @@ variables:
stages:
- test
- analyze
- build
- deploy
......@@ -110,10 +111,25 @@ npm_test:
stage: test
tags:
- nodejs
artifacts:
paths:
- .lcov_output
script:
- npm install
- export NODE_ENV='test'
- node_modules/nyc/bin/nyc.js --reporter=text node_modules/mocha/bin/mocha
- node_modules/nyc/bin/nyc.js --reporter=text --reporter=lcov --report-dir=.lcov_output node_modules/mocha/bin/mocha
sonarqube:
stage: analyze
tags:
- sonar-cli
dependencies:
- npm_test
only:
- staging
script:
- npm i
- sonar-scanner -Dsonar.login=$SONAR_TOKEN -Dsonar.host.url=https://scm.thm.de/sonar/
deploy:
stage: deploy
......
......@@ -13,7 +13,7 @@
"description": "Version 2 of arsnova.click (Backend)",
"scripts": {
"clean": "rimraf dist",
"test": "node node_modules/nyc/bin/nyc.js --reporter=text node_modules/mocha/bin/mocha",
"test": "node node_modules/nyc/bin/nyc.js --reporter=text --reporter=lcov --report-dir=.lcov_output node_modules/mocha/bin/mocha",
"prebuild:DEV": "npm run clean",
"prebuild:PROD": "npm run clean",
"build:DEV": "tsc && cp -r assets dist/",
......
# Required metadata
sonar.projectKey=arsnova-click-v2-backend
sonar.projectName=arsnova.click Backend
sonar.projectVersion=2.0
sonar.language=ts
sonar.sources=./src
sonar.exclusions=dist/**/*, node_modules/**/*, **/*.spec.ts
sonar.sourceEncoding=UTF-8
sonar.tests=./src
sonar.test.inclusions=**/*.spec.ts
sonar.host.url=http://sonarqube:9000
sonar.typescript.lcov.reportPaths=.lcov_output/lcov.info
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