【问题标题】:Configure SonarQube (Node.JS) to download binaries from an internal server配置 SonarQube (Node.JS) 以从内部服务器下载二进制文件
【发布时间】:2021-02-19 08:07:05
【问题描述】:

我们正在尝试让 SonarQube 在 Docker 映像上分析我们的 Typescript (Node.JS) 项目,但我们遇到了错误。如果有帮助,我们正在尝试使用 Node.JS 中的 sonarqube-scanner 模块。

遇到的错误如下:

[17:57:23] Starting analysis...
[17:57:24] Getting info from "package.json" file
[17:57:24] Checking if executable exists: /root/.sonar/native-sonar-scanner/sonar-scanner-4.5.0.2216-linux/bin/sonar-scanner
[17:57:24] Could not find executable in "/root/.sonar/native-sonar-scanner".
[17:57:24] Proceed with download of the platform binaries for SonarScanner...
[17:57:24] Creating /root/.sonar/native-sonar-scanner
[17:57:24] Downloading from https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.5.0.2216-linux.zip
[17:57:24] (executable will be saved in cache folder: /root/.sonar/native-sonar-scanner)
[91m[18:03:53] [0m[91mERROR: impossible to download and extract binary: connect ETIMEDOUT 91.134.125.245:443
[0m[91m[18:03:53] [0m[91m       SonarScanner binaries probably don't exist for your OS (linux).
[0m[91m[18:03:53]        In such situation, the best solution is to install the standard SonarScanner (requires a JVM).
[0m[91m[18:03:53]        Check it out at https://redirect.sonarsource.com/doc/install-configure-scanner.html

现在,如果您从错误中注意到,二进制服务器会遇到 ETIMEDOUT 错误,这是因为访问它的服务器来自无法访问外部站点的内部网络。

是否可以将 SonarQube 配置为从内部服务器提取?如果是这样,我们将如何进行配置?

非常感谢!

【问题讨论】:

标签: configuration sonarqube binaryfiles


【解决方案1】:

我可以通过 SonarQube Javascript 模块在此处 (https://www.npmjs.com/package/sonarqube-scanner) 找到文档

默认情况下,扫描程序二进制文件从https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/ 下载。要使用自定义镜像,请设置 $SONAR_SCANNER_MIRROR。或使用 $SONAR_SCANNER_VERSION 下载精确版本

例子:

导出 SONAR_SCANNER_MIRROR=https://npm.taobao.org/mirrors/sonar-scanner/ 导出 SONAR_SCANNER_VERSION=3.2.0.1227

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-01-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-02
    • 1970-01-01
    • 1970-01-01
    • 2010-09-15
    相关资源
    最近更新 更多