diff --git a/irc_api.drone.yml b/irc_api.drone.yml index f82253648..0044289ab 100644 --- a/irc_api.drone.yml +++ b/irc_api.drone.yml @@ -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 @- < 项目:${DRONE_REPO_NAME}\n> 分支:${DRONE_BRANCH}\n> 构建号:${DRONE_BUILD_NUMBER}\n> 状态:${STATUS}" + "content": "${MSG} +> 项目:${DRONE_REPO_NAME} +> 分支:${DRONE_BRANCH} +> 构建号:${DRONE_BUILD_NUMBER} +> 状态:${STATUS}" } } 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 \ No newline at end of file + - Test_HIR_Net8