From a3260aadc3a8307c146a59e2244fc067d71e4daa Mon Sep 17 00:00:00 2001 From: Alya Sirko Date: Fri, 16 Sep 2022 10:31:51 +0300 Subject: [PATCH] Add SonarQube to Pipeline (#15) Co-authored-by: Alya Sirko Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api/pulls/15 Co-authored-by: Alya Sirko Co-committed-by: Alya Sirko --- .drone.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.drone.yml b/.drone.yml index 5f89a9c..0f5f93a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,18 +2,23 @@ kind: pipeline type: exec name: default -platform: - os: linux - arch: amd64 - steps: -- name: test +- name: Run Tests and Generate Coverage Report commands: - coverage run -m pytest -q - coverage xml -- name: bandit + - sonar-scanner -Dsonar.projectKey=SelfPrivacy-REST-API -Dsonar.sources=. -Dsonar.host.url=http://analyzer.lan:9000 -Dsonar.login="$SONARQUBE_TOKEN" + environment: + SONARQUBE_TOKEN: + from_secret: SONARQUBE_TOKEN + +- name: Run Bandit Checks commands: - bandit -ll -r selfprivacy_api -- name: formatting + +- name: Run Code Formatting Checks commands: - black --check . + +node: + server: builder