我正在尝试将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发布于 2022-08-10 15:57:07
看上去像是
- sonar-scanner -Dsonar.qualitygate.wait=true找不到命令。尝试在正在设置管道的机器上运行该命令(就像ssh进入该机器或ssh进入该机器并尝试运行该命令)。问题可能是它没有安装在那里。
https://stackoverflow.com/questions/73305098
复制相似问题