Advertisement
PandaAcademy

Sonarqube analysis pipeline

Oct 7th, 2023 (edited)
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. pipeline {
  2. agent {
  3. label 'agent'
  4. }
  5.  
  6. environment {
  7. PIP_BREAK_SYSTEM_PACKAGES = 1
  8. scannerHome = tool 'SonarQube'
  9. }
  10.  
  11. stages {
  12. stage('Get Code') {
  13. steps {
  14. git branch: 'jenkinsfile', url: 'https://github.com/Panda-Academy-Core-2-0/Frontend'
  15. }
  16. }
  17.  
  18. stage('Unit tests') {
  19. steps {
  20. sh "pip3 install -r requirements.txt"
  21. sh "python3 -m pytest --cov=. --cov-report xml:test-results/coverage.xml --junitxml=test-results/pytest-report.xml"
  22. }
  23. }
  24.  
  25. stage('Sonarqube analysis') {
  26. steps {
  27. withSonarQubeEnv('SonarQube') {
  28. sh "${scannerHome}/bin/sonar-scanner"
  29. }
  30. }
  31. }
  32. }
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement