mirror of
https://github.com/lddsb/drone-dingtalk-message.git
synced 2026-06-16 14:50:42 +08:00
121 lines
3.4 KiB
Markdown
121 lines
3.4 KiB
Markdown
# Drone CI DingTalk Message Plugin
|
|
[](https://drone.lddsb.com/lddsb/drone-dingtalk-message) [](https://goreportcard.com/report/github.com/lddsb/drone-dingtalk-message) [](https://codecov.io/gh/lddsb/drone-dingtalk-message) [](https://codebeat.co/projects/github-com-lddsb-drone-dingtalk-message-master) [](LICENSE)
|
|
|
|
### Drone CI Plugin Config
|
|
`0.8.x`
|
|
```yaml
|
|
pipeline:
|
|
...
|
|
notification:
|
|
image: lddsb/drone-dingtalk-message
|
|
token: your-group-bot-token
|
|
type: markdown
|
|
```
|
|
|
|
`1.0.x`
|
|
```yaml
|
|
kind: pipeline
|
|
name: default
|
|
|
|
steps:
|
|
...
|
|
- name: notification
|
|
image: lddsb/drone-dingtalk-message
|
|
settings:
|
|
token: your-groupbot-token
|
|
type: markdown
|
|
|
|
```
|
|
|
|
### Plugin Parameter Reference
|
|
`token`(required)
|
|
|
|
String. Access token for group bot. (you can get the access token when you add a bot in a group)
|
|
|
|
`type`(required)
|
|
|
|
String. Message type, plan support text, markdown, link and action card, but due to time issue, it's only support `markdown` and `text` now, and you can get the best experience by use markdown.
|
|
|
|
`tips_title`
|
|
|
|
String. You can customize the title for the message tips, just work when message type is markdown.
|
|
|
|
`message_color`(when `type=markdown`)
|
|
|
|
Boolean value. This option can change the title and commit message color if turn on.
|
|
|
|
`success_color`(when `message_color=true`)
|
|
|
|
String. You can customize the color for the `build success` message by this option, you should input a hex color, example: `008000`.
|
|
|
|
`failure_color`(when `message_color=true`)
|
|
|
|
String. You can customize the color for the `build success` message by this option, you should input a hex color, example: `FF0000`.
|
|
|
|
`sha_link`(when `type=markdown`)
|
|
|
|
Boolean value. This option can link the sha to your source page when it turn on.
|
|
|
|
`message_pic`(when `type=markdown`)
|
|
|
|
Boolean value. If this option turn on, it will embed a image into the message.
|
|
|
|
`success_pic`(when `message_pic=true`)
|
|
|
|
String. You can customize the picture for the `build success` message by this option.
|
|
|
|
`failure_pic`(when `message_pic=true`)
|
|
|
|
String. You can customize the picture for the `build failure` message by this option.
|
|
|
|
### Screen Shot
|
|
- Send Success
|
|
|
|

|
|
|
|
- Missing Access Token
|
|
|
|

|
|
|
|
- Missing Message Type Or Not Support Message Type
|
|
|
|

|
|
|
|
- Markdown DingTalk Message(default)
|
|
|
|

|
|
|
|
- Markdown DingTalk Message(color and sha link)
|
|
|
|

|
|
|
|
- Markdown DingTalk Message(color, pic and sha link)
|
|
|
|

|
|
|
|
### Todo
|
|
|
|
- Multi-Type
|
|
- Multi-Lang
|
|
- More User Customization
|
|
|
|
|
|
### Development
|
|
|
|
- First get this repo
|
|
```shell
|
|
go get github.com/lddsb/drone-dingtalk-message
|
|
```
|
|
- get dependent lib
|
|
```shell
|
|
dep ensure
|
|
```
|
|
- build
|
|
```shell
|
|
cd $GOPATH/src/github.com/lddsb/drone-dingtalk-message && go build .
|
|
```
|
|
- run
|
|
```shell
|
|
./drone-dingtalk-message -h
|
|
```
|