测试6
parent
de500f28cd
commit
41c5686ac9
|
|
@ -23,6 +23,10 @@ steps:
|
|||
- name: notify-wecom
|
||||
commands:
|
||||
- |
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Drone CI 构建状态
|
||||
STATUS="$DRONE_BUILD_STATUS"
|
||||
|
||||
if [ "$STATUS" = "success" ]; then
|
||||
|
|
@ -33,16 +37,26 @@ steps:
|
|||
COLOR="warning"
|
||||
fi
|
||||
|
||||
curl -s -X POST "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=cdd97aab-d256-4f07-9145-a0a2b1555322" \
|
||||
-H "Content-Type: application/json" \
|
||||
--data-binary @- <<EOF
|
||||
# 构建 JSON 数据
|
||||
JSON_DATA=$(cat <<EOF
|
||||
{
|
||||
"msgtype": "markdown",
|
||||
"markdown": {
|
||||
"content": "${MSG}\n> 项目:${DRONE_REPO_NAME}\n> 分支:${DRONE_BRANCH}\n> 构建号:${DRONE_BUILD_NUMBER}\n> 状态:<font color=\"${COLOR}\">${STATUS}</font>"
|
||||
"content": "${MSG}
|
||||
> 项目:${DRONE_REPO_NAME}
|
||||
> 分支:${DRONE_BRANCH}
|
||||
> 构建号:${DRONE_BUILD_NUMBER}
|
||||
> 状态:<font color=\"${COLOR}\">${STATUS}</font>"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
)
|
||||
|
||||
# 发送企业微信通知
|
||||
curl -s -X POST "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=cdd97aab-d256-4f07-9145-a0a2b1555322" \
|
||||
-H "Content-Type: application/json" \
|
||||
--data-binary "$JSON_DATA"
|
||||
|
||||
when:
|
||||
status:
|
||||
- success
|
||||
|
|
@ -50,4 +64,4 @@ EOF
|
|||
|
||||
trigger:
|
||||
branch:
|
||||
- Test_HIR_Net8
|
||||
- Test_HIR_Net8
|
||||
|
|
|
|||
Loading…
Reference in New Issue