SonarQube scanner analysis skipped in travis CI


Does anyone know why it was possible to skip the analysis of the SonarQube scanner?

$ 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. 
+6
source share
2 answers

Finally, I discovered that hadron sleep-sharvir-treving itself set the following environment 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 

In fact, I was working on another branch: DEV.

Thus, the solution has the following form: .travis.yml :

 sonarqube: branches : - DEV 

And in sonar-project.properties:

 sonar.branch=DEV 
+7
source

I added a branch under the add-ons to travis.yml, as well as a sonar branch in the sonar properties file, but the SonarQube analysis is skipped. How to fix it?

Additional services: sonarqube: token: secure: "XXXXXXXXXXXXXXXXXXXXXXXXXXX" branches:

development added to travis.yml

and in sonar-project.properties, I added this key also sonar.branch = development

but travis is always $ export SONARQUBE_SKIPPED = true

0.41s $ sonar scanner

INFO: scanner configuration file: /home/travis/.sonarscanner/sonar-scanner-2.8/conf/sonar-scanner.properties

INFO: Project root file configuration file: / home /........../ sonar-project.properties

INFO: SonarQube scanner analysis skipped

0
source

Source: https://habr.com/ru/post/1012334/


All Articles