简体   繁体   English

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

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

I am trying to integrate Sonarqube into my project CI/CD pipeline on Gitlab.我正在尝试将 Sonarqube 集成到 Gitlab 上的项目 CI/CD 管道中。 I have followed the documentation on Gitlab and Sonarqube to the best of my understanding to get the job included in my yml file.我已尽我所能遵循有关 Gitlab 和 Sonarqube 的文档,以便将工作包含在我的 yml 文件中。

I am current experiencing the error as shown in the image below我目前遇到的错误如下图所示在此处输入图像描述

This is my yml file script这是我的 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

It looks like the它看起来像

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

command is not found.找不到命令。 Try to run that command on the machine you are setting up your pipeline (like ssh into that machine or ssh into it and try running that command).尝试在您正在设置管道的机器上运行该命令(例如 ssh 进入该机器或 ssh 进入它并尝试运行该命令)。 The issue might be that it isn't installed on there.问题可能是它没有安装在那里。

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

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