update feishu

This commit is contained in:
朱潮 2026-04-21 20:17:31 +08:00
parent 39e8db1ebc
commit 6b23688c2e

View File

@ -79,9 +79,22 @@ build_deploy_payload() {
local color="$1"
local short_sha="${CIRCLE_SHA1:0:8}"
local message
local content
message=$(commit_message)
content=$(printf '**触发人**: %s\n**分支**: %s\n**Job**: %s\n**服务**: %s\n**命名空间**: %s\n**Commit**: %s\n**完整 SHA**: %s\n**提交信息**: %s' "$CIRCLE_USERNAME" "$CIRCLE_BRANCH" "$CIRCLE_JOB" "$SERVICE_NAME" "$NAMESPACE" "$short_sha" "$CIRCLE_SHA1" "$message" | escape_json)
local username
local branch
local job
local service_name
local namespace
local commit
local full_sha
message=$(commit_message | escape_json)
username=$(printf '%s' "$CIRCLE_USERNAME" | escape_json)
branch=$(printf '%s' "$CIRCLE_BRANCH" | escape_json)
job=$(printf '%s' "$CIRCLE_JOB" | escape_json)
service_name=$(printf '%s' "$SERVICE_NAME" | escape_json)
namespace=$(printf '%s' "$NAMESPACE" | escape_json)
commit=$(printf '%s' "$short_sha" | escape_json)
full_sha=$(printf '%s' "$CIRCLE_SHA1" | escape_json)
cat <<EOF
{
@ -100,10 +113,64 @@ build_deploy_payload() {
"elements": [
{
"tag": "div",
"text": {
"tag": "lark_md",
"content": "${content}"
}
"fields": [
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**触发人**\n${username}"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**分支**\n${branch}"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**Job**\n${job}"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**服务**\n${service_name}"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**命名空间**\n${namespace}"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**Commit**\n${commit}"
}
},
{
"is_short": false,
"text": {
"tag": "lark_md",
"content": "**完整 SHA**\n${full_sha}"
}
},
{
"is_short": false,
"text": {
"tag": "lark_md",
"content": "**提交信息**\n${message}"
}
}
]
},
{
"tag": "action",
@ -129,9 +196,20 @@ build_docker_hub_payload() {
local color="$1"
local short_sha="${CIRCLE_SHA1:0:8}"
local message
local content
message=$(commit_message)
content=$(printf '**触发人**: %s\n**分支**: %s\n**Job**: %s\n**镜像**: %s:%s\n**版本标签**: %s\n**Commit**: %s\n**完整 SHA**: %s\n**提交信息**: %s' "$CIRCLE_USERNAME" "$CIRCLE_BRANCH" "$CIRCLE_JOB" "$IMAGE_REPO" "$IMAGE_TAG" "$VERSION_TAG" "$short_sha" "$CIRCLE_SHA1" "$message" | escape_json)
local username
local branch
local job
local image
local commit
local full_sha
message=$(commit_message | escape_json)
username=$(printf '%s' "$CIRCLE_USERNAME" | escape_json)
branch=$(printf '%s' "$CIRCLE_BRANCH" | escape_json)
job=$(printf '%s' "$CIRCLE_JOB" | escape_json)
image=$(printf '%s' "$IMAGE_REPO:$VERSION_TAG" | escape_json)
commit=$(printf '%s' "$short_sha" | escape_json)
full_sha=$(printf '%s' "$CIRCLE_SHA1" | escape_json)
cat <<EOF
{
@ -150,10 +228,57 @@ build_docker_hub_payload() {
"elements": [
{
"tag": "div",
"text": {
"tag": "lark_md",
"content": "${content}"
}
"fields": [
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**触发人**\n${username}"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**分支**\n${branch}"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**Job**\n${job}"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**镜像**\n${image}"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**Commit**\n${commit}"
}
},
{
"is_short": false,
"text": {
"tag": "lark_md",
"content": "**完整 SHA**\n${full_sha}"
}
},
{
"is_short": false,
"text": {
"tag": "lark_md",
"content": "**提交信息**\n${message}"
}
}
]
},
{
"tag": "action",