1、钉钉管理员开启机器人
2、钉钉管理员设置消息关键词例如“发布”
3、设置脚本如下
文件名 dingding.sh
TOKEN="xxxxxd65xxxxxxxxxxdabxx7a54c0xxxxxxxxxx"
curl 'https://oapi.dingtalk.com/robot/send?access_token='${TOKEN}'' \
-H 'Content-Type: application/json' \
-d '
{"msgtype": "text",
"text": {
"content": "XX商城APP,发布成功\n分支 '${BRANCH}'\n提交信息:'${COMMIT_MSG}'\n环境信息: '${ENV}' \n请到 http://d.6short.com/xxxx 或 https://www.pgyer.com/xxxx 扫码下载 密码 xx"
}
}'
4、顶顶群里将会收到如下通知
XX商城APP,发布成功
分支 origin/feature/appupdate
提交信息:7c4bdd765a0a2ab9c5f683631ed4d20c6ffb2f6a
环境信息: production
请到 http://d.6short.com/xxxx 或 https://www.pgyer.com/xxxx 扫码下载 密码 xx
5、问题解决