azure - Gitlab 管道作业 token 失败

标签 azure docker ubuntu sonarqube gitlab-ci

我有 Gitlab 社区,我正在尝试将其与 SonarQube 集成。 Sonar 托管在 Docker 容器中的 Azure VM Ubuntu 上。问题是我真的不知道怎么写gitlab-ci.yml。我已经尝试过 Sonar ,但本地托管在 Windows 计算机上。这是我当前的 gitlab-ci.yml

当我用当前的 Sonar 主机更换时,我不确定需要在 Sonar 上安装什么。登录然后抛出错误:

SonarScanner for MSBuild 5.0.4
Using the .NET Framework version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories...
18:35:07.168 Updating build integration targets...
18:35:07.394 The token you provided doesn't have sufficient rights to check license.

sonar-check:
  image:
    name: sonarsource/sonar-scanner-cli:latest
    entrypoint: [""]
  cache:
    key: "${CI_JOB_NAME}"
    paths:
      - .sonar/cache
  dependencies:
    - build
  script:
    - choco install sonarqube-scanner.portable
    - SonarScanner.MSBuild.exe begin /k:"somefile" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="8f6658e7684de225a4f45c7cf3466d462a95c1c7"   
    - nuget restore -ConfigFile .\nuget.config
    - MsBuild.exe ./Process /t:Rebuild
    - SonarScanner.MSBuild.exe end /d:sonar.login="8f6658e7684de225a4f45c7cf3466d462a95c1c7"
  only:
    - merge_requests
    - master
    - develop
    - GitLabQualityTool

最佳答案

也许您的 SonarQube 扫描仪已过时

我遇到了同样的问题Error Message

我通过这个命令解决了这个问题 dotnet工具更新--global dotnet-sonarscanner

enter image description here

之后就成功了

enter image description here

关于azure - Gitlab 管道作业 token 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65327608/

相关文章:

node.js - Azure 中的 node.js RabbitMQ 使用者上的 ECONNRESET

php - 从一个容器到另一个容器访问服务

reactjs - 在使用 docker 的 create-react-app 生产中使用不同 API URL 的最佳方法是什么?

PHP fatal error : class sqlite3 is not found in

azure - 使用 Az CLI 创建新的 Azure 容器实例时,无法从私有(private) Azure 容器注册表中提取镜像

c# - 以编程方式删除 Azure 应用程序注册 API 权限

docker - 如何通过更新 docker 注册表服务器来修复客户端上的不安全注册表错误

C - 如何在 linux 中使用 API 库

ubuntu - 如何从外部访问规范的 kubernetes 仪表板?

azure - 将 SSL 证书附加到 Terraform 中的 Azure 应用程序网关