我已经设置了一个 jenkins-sonarqube-github 集成工作流程,其中 git 存储库中的拉取请求触发一个 webhook,该 webhook 启动 jenkins 作业,从而启动 SonarQube Scanner。问题是我无法将其发布到 SonarQube 前端,而不是 Github。
Github 结果最多只显示 10 个最重要的问题,而我的团队需要能够看到整个分析结果。据我所知,这只能通过前端实现。
问题:我设置了两个单独的分析作业。一个触发 github 评论行为(Sonarqube Github 插件),但我无法让另一个简单地发布到服务器。我在后一份工作中删除了所有与 github 相关的配置,但它只是以“成功”结束,并且没有在任何地方报告。任何帮助,将不胜感激。
图。1。工作 SonarQube 扫描仪属性发布到 github 而不是服务器
sonar.projectKey=${componentName}
sonar.projectVersion=0.1
sonar.sourceEncoding=UTF-8
sonar.analysis.mode=issues
sonar.profile=My_Analysis_Profile
sonar.github.repository=${repository}
sonar.github.endpoint=https://customossendpoint/api/v3
sonar.github.login=someusername
sonar.github.oauth=somehashkey123
sonar.login=id
sonar.password=pass
sonar.github.pullRequest=${pr}
sonar.host.url=http://sonarserver:19000
sonar.issuesReport.console.enable=true
sonar.github.disableInlineComments=false
sonar.sources=.
sonar.exclusions=
sonar.java.binaries=**/target/classes
图2.我试图调整以停止将结果发送到 github 并改为发布(发送)到 sonarqube 服务器(sonar.analysis.mode=publish 至少在声纳 6.x 中不存在)的配置不起作用
sonar.projectKey=${componentName}
sonar.projectVersion=0.1
sonar.sourceEncoding=UTF-8
sonar.analysis.mode=issues
sonar.profile=My_Analysis_Profile
sonar.login=id
sonar.password=pass
sonar.host.url=http://sonarserver:19000
sonar.issuesReport.console.enable=false
sonar.sources=.
sonar.exclusions=
sonar.java.binaries=**/target/classes
图3.日志:(抱歉,由于...公司问题,我不能将整个日志粘贴到此处。如果需要,我会在审查后添加整个日志。)
...
INFO: Issues mode
WARN: The use of the issues mode (sonar.analysis.mode=issues) is deprecated. This mode will be dropped in the future.
INFO: Load global settings
INFO: Load global settings (done) | time=68ms
INFO: Server id: asdfasdf
INFO: User cache: /home1/irteam/.sonar/cache
INFO: Exclude plugins: devcockpit, ldap, authgithub, authbitbucket, pdfreport, authaad, googleanalytics, governance
INFO: Load plugins index
INFO: Load plugins index (done) | time=59ms
INFO: SonarQube server 6.7.1
INFO: Default locale: "ko_KR", source code encoding: "UTF-8"
INFO: Process project properties
INFO: Load project repositories
WARN: Project doesn't exist on the server. All issues will be marked as 'new'.
...
INFO: Unit Test Coverage Sensor is started
INFO: 888/888 source files have been analyzed
INFO: Integration Test Coverage Sensor is started
INFO: Overall Coverage Sensor is started
INFO: Sensor JavaScript Squid Sensor [javascript] (done) | time=72434ms
INFO: Performing issue tracking
INFO: 19822/19822 components tracked
INFO: ANALYSIS SUCCESSFUL
INFO: Task total time: 4:31.750 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 4:33.207s
INFO: Final Memory: 72M/1513M
INFO: ------------------------------------------------------------------------
Finished: SUCCESS
正如你所看到的,它说WARN: Project doesn't exist on the server.
- 这意味着它应该创建一个新的,然后发布它。然而,它没有发布任何内容,只是以“成功”结束。没有链接或任何报告文件可供查看,它只是以某种方式自行分析并在没有告诉任何人的情况下死亡。我在这里做错了什么?