diff --git a/scripts/git-build-deploy.ps1 b/scripts/git-build-deploy.ps1 index d94b504..64c7a06 100644 --- a/scripts/git-build-deploy.ps1 +++ b/scripts/git-build-deploy.ps1 @@ -95,8 +95,7 @@ if ! ssh -o BatchMode=yes -o ConnectTimeout=10 "$PRODUCTION_SERVER" \ "docker tag '$local_commit' '$remote_commit'" fi -ssh -o BatchMode=yes "$PRODUCTION_SERVER" \ - "REMOTE_IMAGE='$remote_commit' IMAGE_TAG='$image_tag' COMMIT_SHA='$commit_sha' bash -s" <<'PRODUCTION' +production_script="$(cat <<'PRODUCTION' set -Eeuo pipefail target=/mnt/PoolOne/apps/youyidian-notification-center @@ -169,6 +168,10 @@ printf '\nCONTAINER_IMAGE=' docker inspect -f '{{.Config.Image}}' youyidian-notification-center printf '\n' PRODUCTION +)" + +printf '%s\n' "$production_script" | ssh -o BatchMode=yes "$PRODUCTION_SERVER" \ + "REMOTE_IMAGE='$remote_commit' IMAGE_TAG='$image_tag' COMMIT_SHA='$commit_sha' bash -s" ok "通知中心已部署到 ${commit_sha}" '@