From c7b58067a853edf916e5c0973d2d8ea22cf88ed8 Mon Sep 17 00:00:00 2001 From: leiyun Date: Thu, 11 Jun 2026 18:16:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- isolated/build-update.sh | 12 ++++++++++-- isolated/deploy-from-url.sh | 2 +- isolated/publish-cos.sh | 30 ++++++++++++++++++++++++++---- 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/isolated/build-update.sh b/isolated/build-update.sh index 9a3927c..5b66d8b 100644 --- a/isolated/build-update.sh +++ b/isolated/build-update.sh @@ -319,10 +319,17 @@ save_images archive_package publish_package -cat <" + Copy $(basename "$PACKAGE_ARCHIVE") to the target server, then run: Manual fallback: mkdir -p /tmp/emp-update @@ -331,3 +338,4 @@ Manual fallback: bash apply-update.sh EOF +fi diff --git a/isolated/deploy-from-url.sh b/isolated/deploy-from-url.sh index 50bc8cd..fe23b15 100644 --- a/isolated/deploy-from-url.sh +++ b/isolated/deploy-from-url.sh @@ -8,7 +8,7 @@ set -Eeuo pipefail DEPLOY_ENV="${DEPLOY_ENV:-emp-test}" PROJECT_NAME="${PROJECT_NAME:-$DEPLOY_ENV}" -DEPLOY_HOME="${DEPLOY_HOME:-/home/admin-x99/$DEPLOY_ENV}" +DEPLOY_HOME="${DEPLOY_HOME:-/home/admin-x99/emp/$DEPLOY_ENV}" PACKAGE_URL="${1:-}" EXPECTED_SHA256="${PACKAGE_SHA256:-${2:-}}" RUN_ID="${RUN_ID:-$(date '+%Y%m%d%H%M%S')}" diff --git a/isolated/publish-cos.sh b/isolated/publish-cos.sh index d9fb715..be82430 100644 --- a/isolated/publish-cos.sh +++ b/isolated/publish-cos.sh @@ -12,6 +12,7 @@ set -Eeuo pipefail # COS_KEY=deploy/emp-uat/update/package.tar.gz # COS_SIGN_EXPIRE=604800 # COS_CONFIG_PATH=/path/to/.cos.yaml +# TARGET_BASE_DIR=/home/admin-x99/emp SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -19,6 +20,7 @@ DEPLOY_ENV="${DEPLOY_ENV:-emp-test}" PACKAGE_KIND="${PACKAGE_KIND:-}" COSCLI_BIN="${COSCLI_BIN:-coscli}" COS_SIGN_EXPIRE="${COS_SIGN_EXPIRE:-604800}" +TARGET_BASE_DIR="${TARGET_BASE_DIR:-/home/admin-x99/emp}" log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" @@ -55,6 +57,28 @@ infer_package_kind() { fi } +print_target_deploy_command() { + local target_deploy_home target_script_dir + target_deploy_home="${TARGET_DEPLOY_HOME:-$TARGET_BASE_DIR/$DEPLOY_ENV}" + + if [[ "$PACKAGE_KIND" == "update" ]]; then + target_script_dir="${TARGET_SCRIPT_DIR:-$target_deploy_home/runtime}" + else + target_script_dir="${TARGET_SCRIPT_DIR:-$TARGET_BASE_DIR}" + fi + + cat <