From a0ef1728cf28162897660d65a2825e7d7e013be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=BD=AE?= Date: Wed, 29 Apr 2026 19:54:22 +0800 Subject: [PATCH] ci: notify after image push succeeds Co-Authored-By: Claude Opus 4.6 (1M context) --- .circleci/config.yml | 7 +++++++ scripts/ci/notify_feishu.sh | 13 ++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7ba130c..86cd7c5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,6 +28,13 @@ jobs: region: AWS_REGION repo: <> 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/<>" \ + --version-tag "<>${CIRCLE_SHA1}" deploy: machine: image: ubuntu-2204:current diff --git a/scripts/ci/notify_feishu.sh b/scripts/ci/notify_feishu.sh index 0785693..76f8733 100644 --- a/scripts/ci/notify_feishu.sh +++ b/scripts/ci/notify_feishu.sh @@ -205,7 +205,7 @@ build_deploy_payload() { EOF } -build_docker_hub_payload() { +build_image_push_payload() { local color="$1" local short_sha="${CIRCLE_SHA1:0:8}" local message @@ -235,7 +235,7 @@ build_docker_hub_payload() { "template": "${color}", "title": { "tag": "plain_text", - "content": "catalog-agent Docker Hub 推送成功" + "content": "catalog-agent 镜像推送成功" } }, "elements": [ @@ -326,9 +326,16 @@ case "$EVENT" in ;; 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) 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 ;; *)