在执行sonarcloud-scan之后,我正在尝试运行sonarcloud-quality-gate检查。我这样做是因为我希望bitbucket构建管道应该在质量门检查失败的情况下失败。
这样做,我得到一些错误,如此质量门失败:无法获取扫描仪报告: Errno 2没有这样的文件或目录:'/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/sonarsource/sonarcloud-scan/sonarcloud-scan.log‘
这就是我的bitbucket.yml的样子。
image: node:10.15.3
clone:
depth: full # SonarCloud scanner needs the full history to assign issues properly
definitions:
caches:
sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
steps:
- step: &build-test-sonarcloud
name: Build, test and analyze on SonarCloud
caches:
- node
- sonar
script:
- npm install --quiet
- npm run test:coverage
- pipe: sonarsource/sonarcloud-scan:0.1.5
variables:
SONAR_TOKEN: ${SONAR_TOKEN}
EXTRA_ARGS: '-Dsonar.sources=src -Dsonar.tests=src -Dsonar.test.inclusions="**.test.jsx" -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info'
- pipe: sonarsource/sonarcloud-quality-gate:0.1.1
variables:
SONAR_TOKEN: ${SONAR_TOKEN}
pipelines:
default:
- step: *build-test-sonarcloud尽管solarcloud-scan管道运行成功。
发布于 2019-10-06 04:29:15
问题是sonarsource/sonarcloud-quality-gate管道需要更新版本的sonarsource/sonarcloud-scan管道。(这是自sonarsource/sonarcloud-quality-gate管道第一次发布以来的情况。)
更改管道配置,如下所示:
- pipe: sonarsource/sonarcloud-scan:1.0.1
variables:
SONAR_TOKEN: ${SONAR_TOKEN}
EXTRA_ARGS: '-Dsonar.sources=src -Dsonar.tests=src -Dsonar.test.inclusions="**.test.jsx" -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info'
- pipe: sonarsource/sonarcloud-quality-gate:0.1.3
variables:
SONAR_TOKEN: ${SONAR_TOKEN}查看最新版本的一种简单方法是在管道编辑器中。当您编辑声纳文件时,会打开一个类似这样的侧栏,您可以在其中输入“bitbucket-pipelines.yml”来过滤列表:

然后,单击管道查看详细信息,并记下使用的版本。
https://stackoverflow.com/questions/56952120
复制相似问题