feat: SonarQube code quality stage
This commit is contained in:
parent
624ae80f66
commit
2ad141354f
18
Jenkinsfile
vendored
18
Jenkinsfile
vendored
@ -88,6 +88,24 @@ print(' Vault se registry creds mil gaye (user=%s)' % d['username'])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage('Code quality (SonarQube)') {
|
||||||
|
when { expression { env.IS_ROLLBACK != 'true' } }
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
set +x
|
||||||
|
ST=$(cat /var/jenkins_secrets/sonar_token)
|
||||||
|
HOST_WS=$(echo "$PWD" | sed "s|^${JENKINS_HOME_CONTAINER}|${JENKINS_HOME_HOST}|")
|
||||||
|
docker run --rm \
|
||||||
|
--network devops \
|
||||||
|
-e SONAR_HOST_URL=http://sonarqube:9000 \
|
||||||
|
-e SONAR_TOKEN="$ST" \
|
||||||
|
-v "$HOST_WS":/usr/src \
|
||||||
|
sonarsource/sonar-scanner-cli:11 \
|
||||||
|
-Dsonar.projectKey=swim-demo-app
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage('Build image') {
|
stage('Build image') {
|
||||||
when { expression { env.IS_ROLLBACK != 'true' } }
|
when { expression { env.IS_ROLLBACK != 'true' } }
|
||||||
steps {
|
steps {
|
||||||
|
|||||||
6
sonar-project.properties
Normal file
6
sonar-project.properties
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
sonar.projectKey=swim-demo-app
|
||||||
|
sonar.projectName=SWIM Demo App
|
||||||
|
sonar.sources=app
|
||||||
|
sonar.tests=tests
|
||||||
|
sonar.python.version=3.12
|
||||||
|
sonar.sourceEncoding=UTF-8
|
||||||
Loading…
Reference in New Issue
Block a user