繁体   English   中英

在 Gitlab CI/CD 上找到声纳扫描仪命令

[英]Sonar scanner command found on Gitlab CI/CD

我正在尝试将 Sonarqube 集成到 Gitlab 上的项目 CI/CD 管道中。 我已尽我所能遵循有关 Gitlab 和 Sonarqube 的文档,以便将工作包含在我的 yml 文件中。

我目前遇到的错误如下图所示在此处输入图像描述

这是我的 yml 文件脚本

build_project:
  stage: build
  script:
    - xcodebuild clean -workspace TinggIOS/TinggIOS.xcworkspace -scheme TinggIOS | xcpretty
    - xcodebuild test -workspace TinggIOS/TinggIOS.xcworkspace -scheme TinggIOS -destination 'platform=iOS Simulator,name=iPhone 11 Pro Max,OS=15' | xcpretty -s
  tags:
    - stage
  image: macos-11-xcode-12

sonarqube-check:
  stage: analyze
  image:
    name: sonarsource/sonar-scanner-cli:latest
    entrypoint: [""]
  variables:
    SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
    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
    - feature/unit-test # or the name of your main branch
    - develop
  tags:
    - stage

它看起来像

- sonar-scanner -Dsonar.qualitygate.wait=true

找不到命令。 尝试在您正在设置管道的机器上运行该命令(例如 ssh 进入该机器或 ssh 进入它并尝试运行该命令)。 问题可能是它没有安装在那里。

暂无
暂无

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

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