Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SonarQube Scanner analysis skipped in travis CI


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.
like image 989
vhamon Avatar asked Nov 15 '16 10:11

vhamon


People also ask

How to do code quality analysis with SonarQube scanner?

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.

Can I use sonarcloud with Travis?

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.

What is SonarQube used for?

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.

Can sonarscanners run with GitLab CI/CD?

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.


1 Answers

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
like image 76
vhamon Avatar answered Dec 26 '22 11:12

vhamon