Skip to content
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
58 changes: 58 additions & 0 deletions .github/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,64 @@ steps:
event:
- tag

- name: notify-release-failure
image: curlimages/curl:8.10.1
pull: if-not-exists
environment:
FEISHU_DEPLOY_WEBHOOK:
from_secret: FEISHU_DEPLOY_WEBHOOK
commands:
- |
set -eu
PAYLOAD="$(
printf \
'{"msg_type":"text","content":{"text":"❌ Clawith 发布失败\\n版本:%s\\n构建:%s\\n提交:%.8s"}}' \
"$DRONE_TAG" "$DRONE_BUILD_LINK" "$DRONE_COMMIT"
)"
RESPONSE="$(
curl --fail-with-body --silent --show-error \
--header 'Content-Type: application/json' \
--data "$PAYLOAD" \
"$FEISHU_DEPLOY_WEBHOOK"
)"
echo "飞书通知响应: $RESPONSE"
printf '%s' "$RESPONSE" |
grep -Eq '"code"[[:space:]]*:[[:space:]]*0([,}])'
when:
event:
- tag
status:
- failure

- name: notify-deployment-success
image: curlimages/curl:8.10.1
pull: if-not-exists
environment:
FEISHU_DEPLOY_WEBHOOK:
from_secret: FEISHU_DEPLOY_WEBHOOK
commands:
- |
set -eu
PAYLOAD="$(
printf \
'{"msg_type":"text","content":{"text":"✅ Clawith 部署成功\\n版本:%s\\n构建:%s\\n提交:%.8s"}}' \
"$DRONE_TAG" "$DRONE_BUILD_LINK" "$DRONE_COMMIT"
)"
RESPONSE="$(
curl --fail-with-body --silent --show-error \
--header 'Content-Type: application/json' \
--data "$PAYLOAD" \
"$FEISHU_DEPLOY_WEBHOOK"
)"
echo "飞书通知响应: $RESPONSE"
printf '%s' "$RESPONSE" |
grep -Eq '"code"[[:space:]]*:[[:space:]]*0([,}])'
when:
event:
- tag
status:
- success

- name: cleanup-ci-images
image: docker:24.0.6
privileged: true
Expand Down
11 changes: 10 additions & 1 deletion deploy/RELEASE_DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ owns CI validation, artifact transfer, and production deployment.
- validate upgrading from the previous stable release;
- export and transfer the target images;
- load the images and recreate the production application services;
- verify the proxied API health endpoint.
- verify the proxied API health endpoint;
- send a Feishu notification when the release succeeds or fails.
5. GitHub Actions publishes the GitHub Release and finishes without waiting for
Drone. Drone continues the deployment asynchronously and reports its status
on the tagged commit.
Expand All @@ -36,6 +37,7 @@ Configure these Drone repository secrets:
| `PROXY` | Optional HTTP/HTTPS proxy used during clone and image builds |
| `PRIVATE_SERVER_IP` | Production server hostname or IP address |
| `sshpwd` | Password for the production deployment user |
| `FEISHU_DEPLOY_WEBHOOK` | Feishu custom bot webhook for successful deployment notifications |

The deployment currently connects as `qinrui` on port `10022` and writes
release artifacts to `/home/qinrui/clawith_new`.
Expand Down Expand Up @@ -75,6 +77,13 @@ The remote deployment loads the transferred images and force-recreates only
are not recreated. Deployment succeeds only after the frontend proxy returns an
API health response whose status is `ok`.

Drone sends the release result, tag, build link, and short commit SHA to the
configured Feishu custom bot. The success message is sent only after the health
check passes. Any failure during a tag pipeline, including build, test,
transfer, restart, or health-check failures, sends a failure message. A
notification API error fails the Drone step so the missing notification is
visible.

If Drone fails, the GitHub tag and Release remain published for investigation.
Fix or rerun the Drone build for that tag; do not move or reuse a published
release tag.