代码之家  ›  专栏  ›  技术社区  ›  Pradeep

当Azure DevOps构建成功或失败时,如何向开发人员发送SonarQube报告

  •  0
  • Pradeep  · 技术社区  · 2 年前

    我已经在Azure DevOps构建管道中集成了SonarQube任务。我可以使用SonarQube成功扫描我的应用程序源代码。

    我想在Sonar构建成功或失败时,将SonarQube报告分享给开发者。

    1 回复  |  直到 2 年前
        1
  •  1
  •   Kağan Mersin    2 年前

    对于通知设置,首先,你需要有邮件服务器,或者你可以使用流行的(Gmail等)。看看下面的文章,了解你需要执行的每一步;

    https://www.fosstechnix.com/sonarqube-email-notifications/

    另一种可能的方法是,如果Sonarqube服务器有限制;

    1. 根据个人资料在Sonarqube中创建质量门 https://docs.sonarqube.org/latest/user-guide/quality-gates/
    2. 如果代码没有通过大门,请使用以下插件中断管道 https://marketplace.visualstudio.com/items?itemName=SimondeLang.sonar-buildbreaker
    3. 在Azure Devops中创建邮件通知,在Sonarqube质量门导致构建失败时发送通知; https://docs.microsoft.com/en-us/azure/devops/notifications/about-notifications?view=azure-devops#team-and-project-level-notifications

    如下图所示,您将在邮件中看到管道构建失败的原因

    enter image description here