zoukankan      html  css  js  c++  java
  • SonarQube钉钉通知插件

    网上看到的钉钉通知插件已经不适用于最新的 SonarQube 了,所以自己花了点时间撸了一下

    仓库地址: https://github.com/akkuman/sonarqube-ding-robot

    参数说明

    Usage of ./sonarqube-ding-robot:
      -addr string
            输入监听地址 (default "0.0.0.0:9001")
      -token string
            输入sonarqube token
    

    使用

    钉钉机器人的配置

    首先打开群机器人添加页面

    添加一个 自定义(通过webhook接入自定义服务) 的机器人

    然后复制出该回调地址

    你会得到一个类似于 https://oapi.dingtalk.com/robot/send?access_token=xxxx 的url,其中的 xxxx 就是钉钉机器人的token

    添加一个安全设置,关键词添加 代码,或者你可以选择ip段,这里不详细说明了

    获取 sonarqube 的token

    按照下图进行生成

    生成后你会得到 sonarqube 的 token

    运行 sonarqube-ding-robot

    下载程序

    wget https://github.com/akkuman/sonarqube-ding-robot/releases/latest/download/sonarqube-ding-robot
    

    或者

    go install github.com/akkuman/sonarqube-ding-robot
    

    然后后台运行该程序(服务)

    chmod +x sonarqube-ding-robot
    nohup ./sonarqube-ding-robot -addr 0.0.0.0:9696 -token sonarqube的token
    

    在sonarqube进行网络调用配置

    如果你想配置全局的网络调用(所有项目都发送通知),进入 sonarqube 的网络调用配置界面 http://xxxx.com/admin/webhooks

    按照上图进行设置

    通知完成

    然后进行扫描后,将会在钉钉群内推送一则通知

    Reference

  • 相关阅读:
    学了这么多年技术,为什么水平还是一般般?
    你能不用计算机来计算S=a+(a+1)+(a+2) + ...... + b的解的数目吗?
    迟来的2013年总结
    如何快速查找IP归属地
    Shiro 权限标签
    Shiro 权限注解
    Shiro 授权
    shiro 身份验证
    Kaptcha
    FastJson
  • 原文地址:https://www.cnblogs.com/Akkuman/p/15353447.html
Copyright © 2011-2022 走看看