Files
soul-yongping/soul-api/deploy/deploy-runner-remote.sh
Alex-larget 6df1736e1e 1
2026-03-20 14:47:37 +08:00

27 lines
947 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# soul-api Runner 部署脚本(在宿主机执行)
# 用法:./deploy-runner-remote.sh [path-to-deploy.tar.gz]
# 默认 tar 路径:${DEPLOY_DOCKER_PATH:-/www/wwwroot/self/soul-dev}/soul_api_deploy.tar.gz
# 仅负责:将 tar 拷入容器并触发容器内 deploy.sh不涉及宝塔/Nginx 配置
set -e
CONTAINER="${DEPLOY_RUNNER_CONTAINER:-soul-api-runner}"
DEPLOY_PATH="${DEPLOY_DOCKER_PATH:-/www/wwwroot/self/soul-dev}"
TAR="${1:-$DEPLOY_PATH/soul_api_deploy.tar.gz}"
if [ -z "$TAR" ] || [ ! -f "$TAR" ]; then
echo "[ERROR] 用法: $0 [path-to-deploy.tar.gz]"
echo " 默认: $DEPLOY_PATH/soul_api_deploy.tar.gz"
exit 1
fi
echo "[1/2] 拷贝部署包到容器 ..."
docker cp "$TAR" "$CONTAINER:/tmp/incoming.tar.gz"
echo "[2/2] 执行容器内红蓝切换 ..."
docker exec "$CONTAINER" /app/deploy.sh /tmp/incoming.tar.gz
rm -f "$TAR"
echo ""
echo "[SUCCESS] 部署完成,宝塔代理 9001 无需修改"