Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.4k views
in Technique[技术] by (71.8m points)

gitlab - Can't get analises report on Sonar Cloud

I use Sonar Cloud to analyze my code with Gitlab CI. How it is usually in the SONAR_HOST_URL I put https://sonarcloud.io , but after the pipeline finish sonar put my analysis into INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard.Why I don't write anywhere this URL. I want the analysis to be in the cloud version.

sonarcloud-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="https://sonarcloud.io" /d:sonar.login="kjhnhgffddsdt"   
    - nuget restore -ConfigFile .
uget.config
    - MsBuild.exe ./Project/t:Rebuild
    - SonarScanner.MSBuild.exe end /d:sonar.login="kjhnhgffddsdt"
  only:           
    - merge_requests
    - master
    - develop
    - GitLabQualityTool

This is the error: INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id. In my gitlab variables SONAR_HOST_URL=https://sonarcloud.io

This is another version that I try:

analyze: 
stage: analyze
image:
  name: sonarsource/sonar-scanner-cli:latest
  entrypoint: [""]
cache:
  key: "${CI_JOB_NAME}"
  paths:
    - .sonar/cache
script:
  - sonar-scanner
only:
  - master
  - IDEA-022

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...