简体   繁体   English

Jenkins和SonarQube是否需要在同一台计算机上?

[英]Do Jenkins and SonarQube need to be on the same machine?

I am trying to run a SonarQube scan from Jenkins job. 我正在尝试从詹金斯的工作中运行SonarQube扫描。 I have the SonarQube Scanner for Jenkins plugin installed v2.6.1 running on local Jenkins (for dev only); 我有在本地Jenkins上运行的v2.6.1安装的SonarQube Scanner for Jenkins插件(仅适用于开发人员);

I have seen conflicting reports on whether or not you can run SonarQube on a different server then Jenkins. 关于是否可以在不同于Jenkins的其他服务器上运行SonarQube的报道,我看到了相互矛盾的报道。 It wouldn't make sense if you could not do that... if you can, instructions on how to accomplish it would be great. 如果您不能这样做就没有任何意义了……如果可以的话,关于如何实现它的说明将是很好的。 Simply putting in the URL to the SQ server where Jenkins expects a directory to Sonar Runner locally, does not work. 只是将URL放入SQ服务器,Jenkins希望在该URL上本地找到Sonar Runner目录,这是行不通的。

Jenkins and SonarQube do not have to be on the same machine. Jenkins和SonarQube不必位于同一台计算机上。

The SonarQube plugin in Jenkins will run one of these three scanners: Jenkins中的SonarQube插件将运行以下三种扫描仪之一:

  • SonarQube Scanner SonarQube扫描仪
  • SonarQube Scanner for Maven 适用于Maven的SonarQube扫描仪
  • SonarQube Scanner for MsBuild 用于MsBuild的SonarQube扫描仪

Depending on which scanner you use, it works a bit differently: 根据您使用的扫描仪,它的工作方式略有不同:

  • For the SonarQube Scanner, pass -Dsonar.host.url=http://your.host:1234 as additional arguments. 对于SonarQube扫描仪,传递-Dsonar.host.url=http://your.host:1234作为附加参数。 (or add it to your sonar.properties file) (或将其添加到您的sonar.properties文件中)

  • For the SonarQube Scanner for Maven, add -Dsonar.host.url=http://your.host:1234 to your maven build step . 对于适用于Maven的SonarQube扫描仪,将-Dsonar.host.url=http://your.host:1234添加到您的maven构建步骤中

  • For the SonarQube Scanner for MsBuild, add /d:sonar.host.url=http://your.host:1234 to your MsBuild.exe call. 对于MsBuild的SonarQube扫描仪,将/d:sonar.host.url=http://your.host:1234添加到您的MsBuild.exe调用中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM