Git Product home page Git Product logo

sonar-dingtalk-plugin's Introduction

SonarQube 钉钉机器人插件

一款简单实用的SonarQube钉钉消息推送插件

💡 使用

安装

docker方式(推荐)

docker run \
-d \
--name=sonar-dingtalk-plugin \
--restart=always \
-p 9010:9010 \
xbmlz/sonar-dingtalk-plugin

# 使用代理
docker run \
-d \
--name=sonar-dingtalk-plugin \
--restart=always \
-p 9010:9010 \
-e HTTPS_PROXY=http://username:password@ip:port \
xbmlz/sonar-dingtalk-plugin

二进制安装

根据对应操作系统下载 Release文件,解压启动即可。

设置

添加钉钉机器人

  1. 打开钉钉[群设置]——[智能群助手]——[添加机器人]——[自定义]

  2. 机器人名字填写SonarQube,头像可根据需求自行更换

  3. 安装设置选择[自定关键词],添加Bugs漏洞

image-20220618135039580

  1. 点击完成后将Webhook地址中access_token=后面的内容复制保存下来(类似https://oapi.dingtalk.com/robot/send?access_token=xxxxxxx)

SonarQube设置

  1. 进入项目,点击[项目配置]——[网络调用]——[创建]

    image-20220618135444058

  2. 名称填写任意值,如DingTalk,URL填写

    http://[插件安装电脑ip]:9010/dingtalk?access_token=[配置钉钉机器人时保存的access_token]&sonar_token=[sonar的token]

    注意:sonar没有开启权限验证时不需要填写

    附:sonarqube 认证token获取方式,点击[配置]——[权限]——[用户]——[令牌]

CI/CD

此步骤可自行百度配置,支持Gitlab、Jenkins等

参考文档:Overview | SonarQube Docs

消息推送

完成上述步骤,就可以将sonarqube扫描结果,推送到钉钉群了

sonar-dingtalk-plugin's People

Contributors

wzslw avatar xbmlz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sonar-dingtalk-plugin's Issues

是否支持代理

由于我的sonarqube部署在内网,无法直接访问钉钉,请问支持代理吗?如果支持的话怎么配置代理?非常感谢!

报400 Bad RequestConnection closed by foreign host错误

[root@master images]# docker run \

-d
--name=sonar-dingtalk-plugin
--restart=always
-p 9010:9010
xbmlz/sonar-dingtalk-plugin
3af4d19ce987d062b473d920a0e99e7e51762450641194d9977114d78afa48b9
[root@master images]# ss -lntup|grep 9010
tcp LISTEN 0 4096 :9010 : users:(("docker-proxy",pid=28407,fd=4))
tcp LISTEN 0 4096 [::]:9010 [::]:
users:(("docker-proxy",pid=28413,fd=4))
[root@master images]# telnet 127.0.0.1 9010
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

HTTP/1.1 400 Bad Request
Content-Type: text/plain; charset=utf-8
Connection: close

400 Bad RequestConnection closed by foreign host.

是否可以加入认证

当sonar开启API强制认证时候,插件是连不上的,不能发送钉钉数据.是否可以加入认证sonar API的功能

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.