Does anyone knows for which reasons a SonarQube Scanner analysis could be skipped ?
$ sonar-scanner -X -Dsonar.host.url=https://sonarqube.com -Dsonar.login=$SONAR_TOKEN
08:59:10.162 INFO: Scanner configuration file: /home/travis/.sonarscanner/sonar-scanner-2.8/conf/sonar-scanner.properties
08:59:10.166 INFO: Project root configuration file: /home/travis/build/armadito/glpi/plugins/armadito/sonar-project.properties
08:59:10.182 INFO: SonarQube Scanner analysis skipped
The command "sonar-scanner -e -X -Dsonar.host.url=https://sonarqube.com -Dsonar.login=$SONAR_TOKEN" exited with 0.
Go to localhost:9000 in your browser, and you see the output as below, project name, and the analysis that is how many numbers of bugs, vulnerabilities, and code smell in the project. You have set up a SonarQube server and Scanner for code quality analysis.
Using SonarCloud with Travis CI. SonarCloud is a cloud service offered by SonarSource and based on SonarQube. SonarQube is a widely adopted open source platform to inspect continuously the quality of source code and detect bugs, vulnerabilities and code smells in more than 20 different languages.
Code Analysis Using SonarQube. Sonarqube is an open-source tool that… | by Madhuri Ghadge | nonstopio Sonarqube is an open-source tool that assists in code quality analysis and reporting.
SonarScanners running in GitLab CI/CD jobs can automatically detect branches or Merge Requests being built so you don't need to specifically pass them as parameters to the scanner. You need to disable git shallow clone to make sure the scanner has access to all of your history when running analysis with GitLab CI/CD.
Finally, I found out that travis-ci's sonarqube addon set by itself the following environnment variable :
export SONARQUBE_SKIPPED=true
With the following message :
Skipping SonarQube Scan because this branch is not master or it does not match declared branches
Indeed, I was working on a different branch: DEV.
Thus, the solution is the following, in .travis.yml :
sonarqube:
branches :
- DEV
And in sonar-project.properties :
sonar.branch=DEV
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With