gitlab - 无法在 GitLab 管道中到达 SONAR_HOST_URL
问题描述
我正在尝试在 GitLab Pipeline 中集成 SonarQube 社区版本来分析我的 .Net Core 项目。我按照这个指令GitLab CI/CD | SonarQube 文档。
但是当我尝试运行此管道时,它会因以下日志而失败: 管道作业结果
我的 gitlab-ci.yml:
sonarqube-check:
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
SONAR_HOST_URL: "https://sonarqube.******.com/"
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- sonar-scanner -Dsonar.qualitygate.wait=true
allow_failure: true
only:
- merge_requests
- master
- develop
我也尝试在 GitLab 的变量设置中指定 SONAR_TOKEN 和 SONAR_HOST_URL,但结果是一样的。任何 SONAR_HOST_URL 链接都会失败并出现相同的错误。
我尝试设置 http://localhost:9000/ 也失败了。我还尝试使用保证 SONAR_HOST_URL 可用的链接(如 google.com),但对于 pipline 也无法访问。
解决方案
推荐阅读
- javascript - 用于显示来自过滤器的随机数组值的按钮
- python - Python pandas:在单元格中查找最大值
- c++ - 平凡与非平凡类型的复制省略差异
- java - Spring Boot 循环依赖与接口
- php - 如何从 react、axios 和 dropzone 前端使用 php 保存文件?
- entity-framework - OData - Entity Framework Core - 如何将 OData 参数从 Controller 注入到 Linq 查询中
- ruby - 如何在 Pry 控制台中提供自定义方法
- python - 将数据帧分区到重叠段
- spring-data-mongodb - Spring data MongoDB查询具有BigDecimal类型字段的文档
- c++ - C++ ^ 运算符与函数一起使用