mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-07 04:09:15 +02:00
feat:#35 added sonarqube
This commit is contained in:
@@ -18,6 +18,8 @@ stages:
|
|||||||
- lint
|
- lint
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
|
- sonarqube-check
|
||||||
|
- sonarqube-vulnerability-report
|
||||||
- oci-build
|
- oci-build
|
||||||
- deploy
|
- deploy
|
||||||
- deploy-dev # New stage for development deployment
|
- deploy-dev # New stage for development deployment
|
||||||
@@ -61,6 +63,46 @@ build-backend:
|
|||||||
- backend/go.sum
|
- backend/go.sum
|
||||||
- backend/go.mod
|
- backend/go.mod
|
||||||
|
|
||||||
|
sonarqube-check-backend:
|
||||||
|
stage: sonarqube-check
|
||||||
|
image:
|
||||||
|
name: sonarsource/sonar-scanner-cli:5.0
|
||||||
|
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:
|
||||||
|
- cd backend
|
||||||
|
- sonar-scanner
|
||||||
|
allow_failure: true
|
||||||
|
only:
|
||||||
|
- merge_requests
|
||||||
|
- master
|
||||||
|
- main
|
||||||
|
- develop
|
||||||
|
|
||||||
|
sonarqube-vulnerability-report-backend:
|
||||||
|
stage: sonarqube-vulnerability-report
|
||||||
|
script:
|
||||||
|
- cd backend
|
||||||
|
- 'curl -u "${SONAR_TOKEN}:" "${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=HTWKalender&branch=${CI_COMMIT_BRANCH}&pullRequest=${CI_MERGE_REQUEST_IID}" -o gl-sast-sonar-report.json'
|
||||||
|
allow_failure: true
|
||||||
|
only:
|
||||||
|
- merge_requests
|
||||||
|
- master
|
||||||
|
- main
|
||||||
|
- develop
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1 day
|
||||||
|
reports:
|
||||||
|
sast: gl-sast-sonar-report.json
|
||||||
|
dependencies:
|
||||||
|
- sonarqube-check
|
||||||
|
|
||||||
build-frontend:
|
build-frontend:
|
||||||
image: node:lts
|
image: node:lts
|
||||||
stage: build
|
stage: build
|
||||||
|
2
sonar-project.properties
Normal file
2
sonar-project.properties
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
sonar.projectKey=HTWKalender
|
||||||
|
sonar.qualitygate.wait=true
|
Reference in New Issue
Block a user