首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何集成sonarcloud和bitbucket?

如何集成sonarcloud和bitbucket?
EN

Stack Overflow用户
提问于 2019-07-19 11:14:34
回答 1查看 1.2K关注 0票数 0

我对sonarcloud非常陌生。我正在尝试将sonarcloud实现到bitbucket管道中。

我按照sonarcloud的教程来分析新项目,然后运行以下代码。

代码语言:javascript
复制
sonar-scanner.bat -D"sonar.projectKey=mywebsite" -D"sonar.organization=xxxxxxxx-bitbucket" -D"sonar.sources=." -D"sonar.host.url=https://sonarcloud.io" -D"sonar.login=xxxxxxxxxxxxxxxxx"

当我运行这段代码时,它显示了代码中的错误,并在最后显示了一些消息。

代码语言:javascript
复制
INFO: ANALYSIS SUCCESSFUL, you can browse https://sonarcloud.io/dashboard?id=mywebsite
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at https://sonarcloud.io/api/ce/task?id=XXXXXXXXXXXXXXXXX

但是当我检入给定的链接时,它显示为空。

在我的bitbucket-pipeline.yml文件中有以下几行

代码语言:javascript
复制
image: atlassian/default-image:2

definitions:
  caches:
    sonar: ~/.sonar/cache

  steps:
    - step: &sonarcloud
        name: Analyze on SonarCloud
        caches:
          - sonar
          - composer
        script:
          - apt-get update
          - composer update --no-interaction --no-suggest --no-progress
          - vendor/bin/phpunit --coverage-clover=coverage-report.clover --log-junit=test-report.xml
          - sonar-scanner
          - pipe: sonarsource/sonarcloud-scan:0.1.5
            variables:
              SONAR_TOKEN: ${SONAR_TOKEN}
pipelines:

有没有人能帮我把这个声纳集成到bitbucket中?

谢谢。

EN

回答 1

Stack Overflow用户

发布于 2020-06-18 19:54:03

尝试此步骤脚本:

代码语言:javascript
复制
  services:
    docker:
      memory: 2560

  steps:
    - step: &sonarcloud
        name: Analyze on SonarCloud
        caches:
          - docker
        script:
          - pipe: sonarsource/sonarcloud-scan:1.0.1
            variables:
              SONAR_TOKEN: ${SONAR_TOKEN}
        services:
          - docker

更多信息:https://gist.github.com/GetoXs/e2b323b048aad88c12a10aceba3cc6cd

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

https://stackoverflow.com/questions/57105038

复制
相关文章

相似问题

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