首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >运行扫描后,SonarCloud质量检查不起作用

运行扫描后,SonarCloud质量检查不起作用
EN

Stack Overflow用户
提问于 2019-07-09 19:59:47
回答 1查看 1.1K关注 0票数 1

在执行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的样子。

代码语言:javascript
复制
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管道运行成功。

EN

回答 1

Stack Overflow用户

发布于 2019-10-06 04:29:15

问题是sonarsource/sonarcloud-quality-gate管道需要更新版本的sonarsource/sonarcloud-scan管道。(这是自sonarsource/sonarcloud-quality-gate管道第一次发布以来的情况。)

更改管道配置,如下所示:

代码语言:javascript
复制
    - 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”来过滤列表:

然后,单击管道查看详细信息,并记下使用的版本。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56952120

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档