-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Features: - 添加 pipeline 调用 - 支持多种消息类型 - 优化默认的展示效果 - 扩展用户属性,添加 `手机号码` 字段 - 支持自动 @ `执行人` - 添加详细文档 Fixes: - 修复 `执行人` 显示 SYSTEM 问题 Closed #30, Closed #28, Closed #25, Closed #24, Closed #22
- Loading branch information
Showing
68 changed files
with
10,065 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,7 @@ work | |
.idea | ||
*.iml | ||
rebel.xml | ||
|
||
# vuepress | ||
docs-dist/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": false, | ||
"singleQuote": true, | ||
"quoteProps": "as-needed", | ||
"trailingComma": "none", | ||
"bracketSpacing": true, | ||
"arrowParens": "avoid", | ||
"requirePragma": false, | ||
"insertPragma": false, | ||
"proseWrap": "preserve", | ||
"htmlWhitespaceSensitivity": "css", | ||
"endOfLine": "lf", | ||
"jsxSingleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
language: node_js | ||
node_js: | ||
- lts/* | ||
install: | ||
- yarn install # npm ci | ||
script: | ||
- yarn docs:build # npm run docs:build | ||
cache: yarn | ||
deploy: | ||
provider: pages:git | ||
edge: true # opt in to dpl v2 | ||
token: $GITHUB_TOKEN # 在 GitHub 中生成,用于允许 Travis 向你的仓库推送代码。在 Travis 的项目设置页面进行配置,添加为环境变量 | ||
target_branch: gh-pages | ||
keep_history: true | ||
commit_message: Deploy %{project_name} to %{url}:%{target_branch} | ||
local_dir: docs-dist # Directory to push to GitHub Pages | ||
project_name: DingTalk # Used in the commit message only (defaults to fqdn or the current repo slug) | ||
deployment_file: true # Enable creation of a deployment-info file | ||
skip_cleanup: true # Make sure you have skip_cleanup set to true, otherwise Travis CI will delete all the files created during the build, which will probably delete what you are trying to upload. | ||
on: | ||
branch: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
const path = require('path') | ||
|
||
module.exports = { | ||
base: '/dingding-notifications-plugin/', | ||
port: 8888, | ||
dest: 'docs-dist', | ||
title: '钉钉机器人插件', | ||
description: '在 Jenkins 中使用钉钉机器人发送消息', | ||
configureWebpack: { | ||
resolve: { | ||
alias: { | ||
'@': path.resolve(__dirname, '../') | ||
} | ||
} | ||
}, | ||
markdown: { | ||
anchor: { permalink: true } | ||
}, | ||
themeConfig: { | ||
docsDir: 'docs', | ||
repo: 'jenkinsci/dingding-notifications-plugin', | ||
sidebarDepth: 1, | ||
editLinks: true, | ||
editLinkText: '在 GitHub 上编辑此页', | ||
lastUpdated: '上次更新', | ||
nav: [ | ||
{ | ||
text: '发布记录', | ||
link: | ||
'https://github.com/jenkinsci/dingding-notifications-plugin/releases' | ||
} | ||
], | ||
sidebar: [ | ||
{ | ||
title: '指南', | ||
path: '/guide/getting-started', | ||
collapsable: false, | ||
children: ['/guide/getting-started', '/guide/simple','/guide/pipeline'] | ||
}, | ||
{ | ||
title: '进阶', | ||
path: '/advance/getting-started', | ||
collapsable: false, | ||
children: ['/advance/user-property', '/advance/markdown'] | ||
}, | ||
{ | ||
title: '示例', | ||
path: '/examples/text', | ||
collapsable: false, | ||
children: [ | ||
'/examples/text', | ||
'/examples/link', | ||
'/examples/markdown', | ||
'/examples/actionCardSingle', | ||
'/examples/actionCardMultiple' | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default ({ | ||
Vue, | ||
options, // 附加到根实例的一些选项 | ||
router, // 当前应用的路由实例 | ||
siteData // 站点元数据 | ||
}) => {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
# Markdown | ||
|
||
## 钉钉支持的语法 | ||
|
||
目前只支持 md 语法的子集,具体支持的元素如下: | ||
|
||
```markdown | ||
|
||
标题 | ||
# 一级标题 | ||
## 二级标题 | ||
### 三级标题 | ||
#### 四级标题 | ||
##### 五级标题 | ||
###### 六级标题 | ||
|
||
引用 | ||
> A man who stands for nothing will fall for anything. | ||
|
||
文字加粗、斜体 | ||
**bold** | ||
*italic* | ||
|
||
链接 | ||
[this is a link](http://name.com) | ||
|
||
图片 | ||
![](http://name.com/pic.jpg) | ||
|
||
无序列表 | ||
- item1 | ||
- item2 | ||
|
||
有序列表 | ||
1. item1 | ||
2. item2 | ||
|
||
``` | ||
|
||
## 定制文字 | ||
|
||
经测试钉钉支持在 markdown 中使用 [font](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/font) 标签。 | ||
|
||
示例: | ||
|
||
1. <font color=red>红色文字</font> | ||
|
||
```markdown | ||
|
||
<font color=red>红色文字</font> | ||
|
||
``` | ||
|
||
2. *<font color=red>红色-斜体文字</font>* | ||
|
||
```markdown | ||
|
||
*<font color=red>红色-斜体文字</font>* | ||
|
||
``` | ||
|
||
3. **<font color=red>红色-加粗文字</font>** | ||
|
||
```markdown | ||
|
||
**<font color=red>红色-加粗</font>** | ||
|
||
``` | ||
|
||
4. ***<font color=red>红色-斜体-加粗文字</font>*** | ||
|
||
```markdown | ||
|
||
***<font color=red>红色-斜体-加粗</font>*** | ||
|
||
``` | ||
|
||
5. <font color=red size=0 >红色-小号文字</font> | ||
|
||
```markdown | ||
|
||
<font color=red size=0 >红色-小号文字</font> | ||
|
||
``` | ||
|
||
6. <font color=red size=3 >红色-正常大小文字</font> | ||
|
||
```markdown | ||
|
||
<font color=red size=3 >红色-正常大小文字</font> | ||
|
||
``` | ||
|
||
|
||
7. <font color=red size=7 >红色-大号文字</font> | ||
|
||
```markdown | ||
|
||
<font color=red size=7 >红色-大号文字</font> | ||
|
||
``` | ||
|
||
8. <font color=red face=KaiTi>红色-楷体文字</font> | ||
|
||
```markdown | ||
|
||
<font color=red face=KaiTi>红色-楷体文字</font> | ||
|
||
``` | ||
|
||
::: warning | ||
|
||
`face` 属性暂未经过测试,在钉钉中表现未知。 | ||
|
||
::: | ||
|
||
::: danger | ||
|
||
同样的 markdown 内容在 `MARKDOWN` 与 `ACTION_CARD` 消息中表现可能不一致,系正常现象,在意的可以去钉钉官方群反馈。 | ||
::: | ||
|
||
![dingTalkLogo](@/assets/dingTalk-logo.png) | ||
|
||
“钉钉机器人交流群(阿里同学加内部群,单聊找我)”群的钉钉群号: 11733391 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# 用户属性扩展 | ||
|
||
为了实现 `执行人` 字段带 `@` 效果,需要为 Jenkins 用户补充相关信息。 | ||
|
||
1. 打开 **Manage Users** | ||
|
||
::: details 查看详细 | ||
|
||
![manage-users](@/assets/manage-users.jpg) | ||
|
||
::: | ||
|
||
2. 设置用户 | ||
|
||
::: details 查看详细 | ||
|
||
![user-setting](@/assets/user-setting.jpg) | ||
|
||
::: | ||
|
||
3. 添加属性 | ||
|
||
::: details 查看详细 | ||
|
||
![user-detail](@/assets/user-detail.jpg) | ||
|
||
::: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# ACTION_CARD 整体跳转 | ||
|
||
## 基础用法 | ||
|
||
```groovy | ||
pipeline { | ||
agent any | ||
stages { | ||
stage('link'){ | ||
steps { | ||
echo '测试 ACTION_CARD 整体跳转消息...' | ||
} | ||
post { | ||
success { | ||
dingTalk ( | ||
robot: '58f10219-2cd3-4de7-a1af-f85f4010c10a', | ||
type: 'ACTION_CARD', | ||
title: '你有新的消息,请注意查收', | ||
text: [ | ||
'![screenshot](@lADOpwk3K80C0M0FoA)', | ||
'### 乔布斯 20 年前想打造的苹果咖啡厅 ', | ||
'Apple Store 的设计正从原来满满的科技感走向生活化,而其生活化的走向其实可以追溯到 20 年前苹果一个建立咖啡馆的计划' | ||
], | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
:::details 查看结果 | ||
|
||
![actionCardMultiple-default-example](@/assets/actionCardMultiple-default-example.jpg) | ||
|
||
::: | ||
|
||
## 自定义按钮组 | ||
|
||
```groovy | ||
btns: [ | ||
[ | ||
title: '内容不错', | ||
actionUrl: 'https://www.dingtalk.com/' | ||
], | ||
[ | ||
title: '不感兴趣', | ||
actionUrl: 'https://www.dingtalk.com/' | ||
] | ||
] | ||
``` | ||
|
||
:::details 查看结果 | ||
|
||
![actionCardMultiple-btns-example](@/assets/actionCardMultiple-btns-example.jpg) | ||
|
||
::: | ||
|
||
## 改变按钮排列方式 | ||
|
||
```groovy | ||
btnLayout: 'V' | ||
``` | ||
|
||
:::details 查看结果 | ||
|
||
![actionCardMultiple-btnLayout-example](@/assets/actionCardMultiple-btnLayout-example.jpg) | ||
|
||
::: | ||
|
||
## At 全部 | ||
|
||
```groovy | ||
atAll: true | ||
``` | ||
|
||
:::details 查看结果 | ||
|
||
![actionCardMultiple-atAll-example](@/assets/actionCardMultiple-atAll-example.jpg) | ||
|
||
::: |
Oops, something went wrong.