ci: notify after image push succeeds

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
朱潮 2026-04-29 19:54:22 +08:00
parent c8637f3418
commit a0ef1728cf
2 changed files with 17 additions and 3 deletions

View File

@ -28,6 +28,13 @@ jobs:
region: AWS_REGION region: AWS_REGION
repo: <<parameters.repo>> repo: <<parameters.repo>>
tag: '<<parameters.docker-tag>>${CIRCLE_SHA1}' tag: '<<parameters.docker-tag>>${CIRCLE_SHA1}'
- run:
name: Send image push Lark notification
command: |
bash scripts/ci/notify_feishu.sh \
--event image_push \
--image-repo "$AWS_ECR_ACCOUNT_URL/<<parameters.repo>>" \
--version-tag "<<parameters.docker-tag>>${CIRCLE_SHA1}"
deploy: deploy:
machine: machine:
image: ubuntu-2204:current image: ubuntu-2204:current

View File

@ -205,7 +205,7 @@ build_deploy_payload() {
EOF EOF
} }
build_docker_hub_payload() { build_image_push_payload() {
local color="$1" local color="$1"
local short_sha="${CIRCLE_SHA1:0:8}" local short_sha="${CIRCLE_SHA1:0:8}"
local message local message
@ -235,7 +235,7 @@ build_docker_hub_payload() {
"template": "${color}", "template": "${color}",
"title": { "title": {
"tag": "plain_text", "tag": "plain_text",
"content": "catalog-agent Docker Hub 推送成功" "content": "catalog-agent 镜像推送成功"
} }
}, },
"elements": [ "elements": [
@ -326,9 +326,16 @@ case "$EVENT" in
;; ;;
esac esac
;; ;;
image_push)
case "$CIRCLE_BRANCH" in
dev|staging|prod|onprem-dev|onprem-release)
send_payload "$(build_image_push_payload "$(header_color)")"
;;
esac
;;
docker_hub) docker_hub)
if [[ "$CIRCLE_BRANCH" == "onprem-release" && "$IMAGE_TAG" == "latest" ]]; then if [[ "$CIRCLE_BRANCH" == "onprem-release" && "$IMAGE_TAG" == "latest" ]]; then
send_payload "$(build_docker_hub_payload "$(header_color)")" send_payload "$(build_image_push_payload "$(header_color)")"
fi fi
;; ;;
*) *)