docker sonarqube laravel





how run docker sonarqube:
Terminal:
docker run -d --name sonarqube sonarqube


descargar el sonar client:
https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner

unzip
Terminal:
unzip sonar-scanner-cli-*

Terminal:
sudo cp -a sonar-scanner-* /opt/

Terminal:
sudo chmod -R 775 /opt/sonar-scanner-*

Terminal:
sudo ln -s /opt/sonar-scanner-3.2.0.1227-linux/bin/sonar-scanner /bin/sonar-scanner

edit values default
Terminal:
sudo nano /opt/sonar-scanner-3.2.0.1227-linux/conf/sonar-scanner.properties



# Required metadata
sonar.projectKey=testproject
sonar.projectName=testproject
sonar.projectVersion=1.0.0

# Path to the parent source code directory.
sonar.sources=app

# Language
# We've commented this out, because we want to analyse both PHP and Javascript
#sonar.language=php

# Encoding of the source code
sonar.sourceEncoding=UTF-8

# Reusing PHPUnit reports
sonar.php.coverage.reportPath=ci/codeCoverage/codeCoverage.xml
sonar.php.tests.reportPath=ci/testResults.xml

# Here, you can exclude all the directories that you don't want to analyse.
# As an example, I'm excluding the Providers directory
sonar.exclusions=app/Providers/**

# Additional parameters
#sonar.my.property=value




add config your proyect in the file sonar-project.properties


# Required metadata
sonar.projectKey=project1
sonar.projectName=project1
sonar.projectVersion=1.0.0

# Path to the parent source code directory.
sonar.sources=app

# Language
# We've commented this out, because we want to analyse both PHP and Javascript
sonar.language=php

# Encoding of the source code
sonar.sourceEncoding=UTF-8

# Reusing PHPUnit reports
sonar.php.coverage.reportPath=ci/codeCoverage/codeCoverage.xml
sonar.php.tests.reportPath=ci/testResults.xml

# Here, you can exclude all the directories that you don't want to analyse.
# As an example, I'm excluding the Providers directory
sonar.exclusions=vendor/**

# Additional parameters
#sonar.my.property=value


run in your proyect


Terminal:
sonar-scanner -e -X


1 comentario :

  1. Que contenido y como genero los archivos phpunit.xml y testResults.xml?

    ResponderEliminar