Compare commits
No commits in common. "7452eae07f43248848b451420b8280313bff45d3" and "41c5686ac9857b5242e31c35e821e5b1480a22c1" have entirely different histories.
7452eae07f
...
41c5686ac9
|
|
@ -20,14 +20,47 @@ steps:
|
||||||
commands:
|
commands:
|
||||||
- bash /opt/1panel/xc-deploy-new/Test_HIR/devops-publish/test-branch-to-test.sh || echo "publish failed"
|
- bash /opt/1panel/xc-deploy-new/Test_HIR/devops-publish/test-branch-to-test.sh || echo "publish failed"
|
||||||
|
|
||||||
- name: notify-wecom
|
- name: notify-wecom
|
||||||
commands:
|
commands:
|
||||||
- bash /opt/1panel/xc-deploy-new/devops-center/notify-wecom.sh "$DRONE_BUILD_STATUS" "$DRONE_REPO_NAME" "$DRONE_BRANCH" "$DRONE_BUILD_NUMBER" "cdd97aab-d256-4f07-9145-a0a2b1555322"
|
- |
|
||||||
when:
|
#!/bin/bash
|
||||||
status:
|
set -e
|
||||||
- success
|
|
||||||
- failure
|
|
||||||
|
|
||||||
|
# Drone CI 构建状态
|
||||||
|
STATUS="$DRONE_BUILD_STATUS"
|
||||||
|
|
||||||
|
if [ "$STATUS" = "success" ]; then
|
||||||
|
MSG="🟢 Test_HIR 发布成功"
|
||||||
|
COLOR="info"
|
||||||
|
else
|
||||||
|
MSG="🔴 Test_HIR 发布失败"
|
||||||
|
COLOR="warning"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 构建 JSON 数据
|
||||||
|
JSON_DATA=$(cat <<EOF
|
||||||
|
{
|
||||||
|
"msgtype": "markdown",
|
||||||
|
"markdown": {
|
||||||
|
"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
|
||||||
|
- failure
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue