travis CI中跳过了SonarQube Scanner分析 [英] SonarQube Scanner analysis skipped in travis CI
本文介绍了travis CI中跳过了SonarQube Scanner分析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道出于什么原因可以跳过SonarQube扫描仪分析的原因吗?
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.
推荐答案
最后,我发现travis-ci的sonarqube插件本身设置了以下环境变量:
Finally, I found out that travis-ci's sonarqube addon set by itself the following environnment variable :
export SONARQUBE_SKIPPED=true
显示以下消息:
Skipping SonarQube Scan because this branch is not master or it does not match declared branches
事实上,我在另一个分支上工作: DEV .
Indeed, I was working on a different branch: DEV.
因此,解决方法如下: .travis.yml :
Thus, the solution is the following, in .travis.yml :
sonarqube:
branches :
- DEV
在sonar-project.properties中
And :
And in sonar-project.properties :
sonar.branch=DEV
这篇关于travis CI中跳过了SonarQube Scanner分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文