如何使用Python-cod在Travis-Ci上运行sonarcloud

2024-05-15 23:35:35 发布

您现在位置:Python中文网/ 问答频道 /正文

我的问题很简单:

如何使用travisci在SonarCloud上插入Python代码?在

我做了前面的步骤:

  • 在Github中创建项目
  • 在Travis Ci中分配该项目
  • 在SonarCloud上创建一个新的项目分析并获取令牌
  • 将SONAR_令牌设置为不可见,并将SonarCloud给出的令牌放入
  • 在。特拉维斯·伊梅尔,在脚本部分添加下一个代码:

    script:
      - python setup.py test
      - ... (other possible commands)
      - sonar-scanner
    

但是,当我做某事时,Travis仍然用下一个工作日志阻止我: This is the log

我搜索了为什么这是可能的,因为特拉维斯说它有声纳扫描仪的能力。在

提前谢谢,祝你今天愉快。在


Tags: 项目代码pytestgithub脚本travisci
1条回答
网友
1楼 · 发布于 2024-05-15 23:35:35

您必须首先在中声明声纳扫描仪为插件。特拉维斯·伊梅尔在

addons:
  sonarcloud:
    organization: "sonarcloud_organization_key" # the key of the org you chose at step #3
    token:
      secure: ********* # encrypted value of your token
script:
  # other script steps might be done before running the actual analysis
  - sonar-scanner

来自https://docs.travis-ci.com/user/sonarcloud/

相关问题 更多 >