我正在尝试使用Github上的travis将SonarQube分析添加到我们的OSS项目中。
我执行了以下步骤:
.travis.yml
sonar-project.properties
文件feature/sonarcloud
最终结果可以在这里看到: https://github.com/open62541/open62541/tree/feature/sonarcloud
不幸的是Travis没有提交声纳分析:
INFO: Scanner configuration file:
/home/travis/.sonarscanner/sonar-scanner-2.8/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner analysis skipped
(另见https://travis-ci.org/open62541/open62541/jobs/287631673)
我已经尝试强制设置export SONARQUBE_SKIPPED=false
,但仍然会跳过它。如何找出跳过扫描仪分析的原因?
相关问题:
答案 0 :(得分:2)
您可以阅读Travis CI logs, at line 556:
Skipping SonarCloud Scan because this branch is not master or it does not match declared branches
这是因为您尚未激活对“feature / sonarcloud”分支的分析。如official documentation中所述,您可以像这样实现:
addons:
sonarcloud:
organization: open62541
token:
secure: "..."
branches:
- master
- feature/sonarcloud