Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

完善配置和使用文档 #53

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,20 @@
企业微信机器人Jenkins插件

### Quick start
- 必要的配置
- 配置企业微信机器人:需要在 jenkins 系统配置中配置企业微信机器人,支持配置多个机器人
- 配置用户的手机号码:需要在 jenkins 用户信息页面,配置企业微信成员手机号码,用于在企业微信中 @ 成员
- 必要的配置
- 配置说明:[参考文档](docs/settings.md)

- 调用说明
- 函数:wxwork()
- 参数:
- robot:字符串,机器人ID,在 jenkins 系统配置中配置的企业微信机器人ID
- type:字符串,企业微信消息类型(text - 文本消息 / markdown - Markdown格式消息 / image - 图片消息)
- atMe:Boolean,消息是否"@"我自己(当前构建任务执行人)
- atAll:Boolean,消息是否"@"所有人
- at:Array<String>:需要被"@"到的人的企业微信成员手机号列表
- text:Array<String>:消息内容数组
- imageUrl:字符串,当前项目图片文件的相对路径(只有`type`为`image`时有效)


- Jenkinsfile (脚本写法)

Expand Down
Binary file added docs/images/stage1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/stage1-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/stage1-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/stage1-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/stage2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions docs/settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 企业微信机器人配置

### 一、配置企业微信机器人

需要在 jenkins 系统配置中配置企业微信机器人,支持配置多个机器人

- 1、点击`全局设置`

![](images/stage1-1.png)

- 2、进入`系统设置`

![](images/stage1-2.png)

- 3、下拉找到`企业微信机器人`,点击`新增`

![](images/stage1-3.png)

- 4、添加机器人信息并测试

![](images/stage1-4.png)

- 5、保存配置即可

### 二、配置企业微信成员的手机号信息

需要在 jenkins 用户信息页面,配置企业微信成员手机号码,这样 jenkins 才知道当前 job 的执行结果应该 @ 那个企业微信中成员

- 进入用户账号设置,配置手机号,这个手机号是用户在企业微信中成员的手机号

![](images/stage2-1.png)
Loading