fix(release): 默认使用 Kubernetes 生产通道
原因:旧 Compose 生产环境已退役,默认通道仍指向 Compose 会在每次发布时先命中无效数据库。\n\n影响:发布和部署脚本默认读取 Kubernetes release helper;仍可通过显式 AI_GATEWAY_DEPLOY_MODE=compose 操作遗留环境。\n\n验证:bash -n、ShellCheck 和 manual-release-test 全部通过。
This commit is contained in:
@@ -3,7 +3,7 @@ set -euo pipefail
|
|||||||
|
|
||||||
root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
||||||
production_host=${AI_GATEWAY_PRODUCTION_HOST:-root@110.42.51.33}
|
production_host=${AI_GATEWAY_PRODUCTION_HOST:-root@110.42.51.33}
|
||||||
deploy_mode=${AI_GATEWAY_DEPLOY_MODE:-compose}
|
deploy_mode=${AI_GATEWAY_DEPLOY_MODE:-kubernetes}
|
||||||
case $deploy_mode in
|
case $deploy_mode in
|
||||||
compose) default_remote_helper=/usr/local/sbin/easyai-ai-gateway-release ;;
|
compose) default_remote_helper=/usr/local/sbin/easyai-ai-gateway-release ;;
|
||||||
kubernetes) default_remote_helper=/usr/local/sbin/easyai-ai-gateway-cluster-release ;;
|
kubernetes) default_remote_helper=/usr/local/sbin/easyai-ai-gateway-cluster-release ;;
|
||||||
@@ -23,6 +23,9 @@ Usage:
|
|||||||
|
|
||||||
This command changes production. Run it only after a successful publish
|
This command changes production. Run it only after a successful publish
|
||||||
command and an explicit user request to release or deploy to production.
|
command and an explicit user request to release or deploy to production.
|
||||||
|
|
||||||
|
AI_GATEWAY_DEPLOY_MODE defaults to kubernetes. Set it to compose only for an
|
||||||
|
explicit legacy-environment operation.
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ cd "$root"
|
|||||||
|
|
||||||
components=auto
|
components=auto
|
||||||
production_host=${AI_GATEWAY_PRODUCTION_HOST:-root@110.42.51.33}
|
production_host=${AI_GATEWAY_PRODUCTION_HOST:-root@110.42.51.33}
|
||||||
deploy_mode=${AI_GATEWAY_DEPLOY_MODE:-compose}
|
deploy_mode=${AI_GATEWAY_DEPLOY_MODE:-kubernetes}
|
||||||
case $deploy_mode in
|
case $deploy_mode in
|
||||||
compose) default_remote_helper=/usr/local/sbin/easyai-ai-gateway-release ;;
|
compose) default_remote_helper=/usr/local/sbin/easyai-ai-gateway-release ;;
|
||||||
kubernetes) default_remote_helper=/usr/local/sbin/easyai-ai-gateway-cluster-release ;;
|
kubernetes) default_remote_helper=/usr/local/sbin/easyai-ai-gateway-cluster-release ;;
|
||||||
@@ -29,6 +29,7 @@ changes production. When the user requested a production release, continue
|
|||||||
with scripts/deploy-production-release.sh without requesting confirmation again.
|
with scripts/deploy-production-release.sh without requesting confirmation again.
|
||||||
|
|
||||||
Environment:
|
Environment:
|
||||||
|
AI_GATEWAY_DEPLOY_MODE Production target (default: kubernetes)
|
||||||
AI_GATEWAY_PRODUCTION_HOST SSH target used for read-only release status
|
AI_GATEWAY_PRODUCTION_HOST SSH target used for read-only release status
|
||||||
AI_GATEWAY_REMOTE_RELEASE_HELPER Fixed status/deploy helper on the server
|
AI_GATEWAY_REMOTE_RELEASE_HELPER Fixed status/deploy helper on the server
|
||||||
AI_GATEWAY_IMAGE_REGISTRY Registry namespace
|
AI_GATEWAY_IMAGE_REGISTRY Registry namespace
|
||||||
|
|||||||
@@ -5,6 +5,15 @@ root=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
|
|||||||
tmp=$(mktemp -d)
|
tmp=$(mktemp -d)
|
||||||
trap 'rm -rf "$tmp"' EXIT
|
trap 'rm -rf "$tmp"' EXIT
|
||||||
|
|
||||||
|
for release_script in \
|
||||||
|
"$root/scripts/publish-release-images.sh" \
|
||||||
|
"$root/scripts/deploy-production-release.sh"; do
|
||||||
|
grep -F "deploy_mode=\${AI_GATEWAY_DEPLOY_MODE:-kubernetes}" "$release_script" >/dev/null || {
|
||||||
|
echo "production release script does not default to Kubernetes: $release_script" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
done
|
||||||
|
|
||||||
new_repo() {
|
new_repo() {
|
||||||
local name=$1
|
local name=$1
|
||||||
local repo=$tmp/$name
|
local repo=$tmp/$name
|
||||||
|
|||||||
Reference in New Issue
Block a user