fix(deploy): 支持 full-themes 六合一包部署并统一 shell 脚本 LF 换行
This commit is contained in:
@@ -13,6 +13,7 @@ INIT_DB=false
|
||||
SKIP_BACKUP=false
|
||||
ALLOW_DEFAULT_SECRETS=false
|
||||
IMAGE_TAR=""
|
||||
WITH_THEMES=false
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
@@ -30,6 +31,7 @@ usage() {
|
||||
--no-build 不构建镜像,直接使用服务器已有镜像
|
||||
--images PATH 先 docker load 指定镜像 tar,并自动跳过本机构建
|
||||
--tag TAG 使用指定镜像 tag,并写入 .env.docker 的 IMAGE_TAG
|
||||
--themes 启用四套 player(player2/3/4);加载 thebet365-full-themes-*.tar 时自动开启
|
||||
--no-seed 不执行生产 seed
|
||||
--init-db 调用 scripts/prod-init-db.sh 清空业务数据并初始化生产数据,仅限全新库或明确重置
|
||||
--skip-backup 与 --init-db 一起使用,跳过 prod-init-db 的备份
|
||||
@@ -39,6 +41,7 @@ usage() {
|
||||
示例:
|
||||
./scripts/deploy-first.sh
|
||||
./scripts/deploy-first.sh --images thebet365-images-v1.2.3.tar --tag v1.2.3
|
||||
./scripts/deploy-first.sh --images thebet365-full-themes-latest.tar --tag latest
|
||||
./scripts/deploy-first.sh --no-build
|
||||
./scripts/deploy-first.sh --init-db
|
||||
EOF
|
||||
@@ -59,6 +62,10 @@ while [ $# -gt 0 ]; do
|
||||
set_deploy_image_tag "${2:?缺少 --tag 参数值}"
|
||||
shift 2
|
||||
;;
|
||||
--themes)
|
||||
WITH_THEMES=true
|
||||
shift
|
||||
;;
|
||||
--no-seed)
|
||||
RUN_SEED=false
|
||||
shift
|
||||
@@ -99,6 +106,12 @@ if [ -n "$IMAGE_TAR" ] && [ -z "${DEPLOY_IMAGE_TAG:-}" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$WITH_THEMES" = true ]; then
|
||||
enable_themes_deploy
|
||||
elif [ -n "$IMAGE_TAR" ]; then
|
||||
maybe_enable_themes_from_tar "$IMAGE_TAR"
|
||||
fi
|
||||
|
||||
if [ -n "$IMAGE_TAR" ]; then
|
||||
load_image_tar "$IMAGE_TAR"
|
||||
fi
|
||||
@@ -118,8 +131,9 @@ if [ "$INIT_DB" = false ] && [ "$RUN_SEED" = true ]; then
|
||||
seed_production_if_missing_admin
|
||||
fi
|
||||
|
||||
log "启动 api / player / admin"
|
||||
compose up -d api player admin
|
||||
log "启动 $(stack_app_services)"
|
||||
# shellcheck disable=SC2046
|
||||
compose up -d $(stack_app_services)
|
||||
wait_for_stack_ready
|
||||
|
||||
if [ "$INIT_DB" = true ]; then
|
||||
|
||||
Reference in New Issue
Block a user