Files
Codex adfb230908
Docker Image / Build and Push Docker Image (push) Successful in 2m2s
chore(release): rename pre-release branch to pre
2026-07-22 10:56:59 +08:00

39 lines
1.3 KiB
Bash
Executable File
Raw Permalink 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
set -euo pipefail
unset_git_hook_env() {
local var
while IFS= read -r var; do
[ -n "$var" ] && unset "$var"
done < <(git rev-parse --local-env-vars 2>/dev/null || true)
}
unset_git_hook_env
# pre 分支 worktree 路径
WORKTREE_PATH="/Users/chase/Documents/frontend/cozsweet-frontend-nextjs.worktrees/cozsweet-nextjs-pre"
echo "=== 进入 pre 分支 worktree ==="
cd "$WORKTREE_PATH" || { echo "错误: 无法进入 $WORKTREE_PATH"; exit 1; }
echo "=== 检查当前分支 ==="
git branch --show-current
echo "=== 变基到 dev 分支 ==="
git rebase dev
# 复制预发环境图标(运行资源目录仍为 icons/test)
echo "=== 复制预发环境图标(icons/test → public/ ==="
cp -f "$WORKTREE_PATH/icons/test/favicon.ico" "$WORKTREE_PATH/public/favicon.ico"
cp -f "$WORKTREE_PATH/icons/test/icons/Icon-192.png" "$WORKTREE_PATH/public/images/icons/Icon-192.png"
cp -f "$WORKTREE_PATH/icons/test/icons/Icon-512.png" "$WORKTREE_PATH/public/images/icons/Icon-512.png"
# 准备预发环境变量(运行配置仍使用 .env.local)
echo "=== 准备预发环境变量(env-example/.env.local.example → .env.local ==="
cp -f "$WORKTREE_PATH/env-example/.env.local.example" "$WORKTREE_PATH/.env.local"
echo "=== 执行构建部署脚本(预发环境)==="
./scripts/deploy/deploy_web_test.sh
echo "=== 预发布完成 ==="