diff --git a/compile.sh b/compile_dev.sh similarity index 100% rename from compile.sh rename to compile_dev.sh diff --git a/compile_test.sh b/compile_prod.sh old mode 100755 new mode 100644 similarity index 80% rename from compile_test.sh rename to compile_prod.sh index ea743fa..b0b23a1 --- a/compile_test.sh +++ b/compile_prod.sh @@ -1,9 +1,9 @@ #!/bin/bash -BRANCH_NAME="dev" +BRANCH_NAME="prod" # 修改项目名称 -PROJECT_NAME="video-flow-frontend-test" +PROJECT_NAME="video-flow-$BRANCH_NAME-frontend" # 设置日志文件路径 LOGFILE="build_and_copy.log" @@ -14,9 +14,9 @@ echo "Build process started at $(date)" | tee $LOGFILE # 获取当前分支名 current_branch=$(git rev-parse --abbrev-ref HEAD) -# 打包之前,需要检查是否在 dev 分支,工作区是否干净,是否和远程分支一致 +# 打包之前,需要检查是否在 prod 分支,工作区是否干净,是否和远程分支一致 if [ "$(git branch --show-current)" != "$BRANCH_NAME" ]; then - echo "当前分支不是 dev 分支" + echo "当前分支不是 prod 分支" exit 1 fi @@ -35,7 +35,7 @@ fi # 检查当前分支并运行相应的 npm 命令 if [ "$current_branch" = "$BRANCH_NAME" ]; then - echo "On dev branch, building project..." | tee -a $LOGFILE + echo "On prod branch, building project..." | tee -a $LOGFILE PROFILE_ENV=$BRANCH_NAME # 安装依赖并构建 @@ -50,7 +50,7 @@ if [ "$current_branch" = "$BRANCH_NAME" ]; then cp package-lock.json dist/ else - echo "On non-dev branch ($current_branch), exiting" + echo "On non-prod branch ($current_branch), exiting" exit 1 fi