hookehuyr

✨ feat: 更新发布脚本

...@@ -11,22 +11,23 @@ ...@@ -11,22 +11,23 @@
11 set -e 11 set -e
12 12
13 # 本地Git服务器目录路径 13 # 本地Git服务器目录路径
14 -path=/Users/huyirui/program/itomix/git/isp/f/custom_form 14 +PHP_PATH=/Users/huyirui/program/itomix/git/isp/f/custom_form
15 15
16 # 编译输出文件夹 16 # 编译输出文件夹
17 -output=front 17 +OUTPUT=front
18 18
19 # 打包 19 # 打包
20 npm run build 20 npm run build
21 21
22 # 移除Git服务器目录下项目文件夹 22 # 移除Git服务器目录下项目文件夹
23 -rm -r $path"/${output:?}" 23 +rm -r $PHP_PATH"/${OUTPUT:?}"
24 24
25 # 把本地编译输出文件夹添加到服务器目录 25 # 把本地编译输出文件夹添加到服务器目录
26 -mv "${output:?}/" $path 26 +mv "${OUTPUT:?}/" $PHP_PATH
27 27
28 # 提交到Git服务器 28 # 提交到Git服务器
29 -cd $path"/${output:?}" 29 +cd $PHP_PATH"/${OUTPUT:?}"
30 +git checkout custom_form
30 git pull 31 git pull
31 git add -A 32 git add -A
32 git commit -m '自定义表单-前端网页更新' 33 git commit -m '自定义表单-前端网页更新'
......
...@@ -10,6 +10,33 @@ ...@@ -10,6 +10,33 @@
10 # 当发生错误时中止脚本 10 # 当发生错误时中止脚本
11 set -e 11 set -e
12 12
13 +# 记录当前开发的绝对路径
14 +CURR_PATH=$(pwd)
15 +
16 +# 本地Git服务器目录路径
17 +PHP_PATH=/Users/huyirui/program/itomix/git/isp/f/custom_form
18 +
19 +# 编译输出文件夹
20 +output=front
21 +
22 +# 打包
23 +npm run build
24 +
25 +# 删除 PHP 项目里的编译产物
26 +cd $PHP_PATH
27 +git checkout custom_form
28 +rm -rf $PHP_PATH"/${output:?}"
29 +# 把编译产物复制到 PHP 项目
30 +cd $CURR_PATH
31 +cp -r "${output:?}/" $PHP_PATH"/${output:?}"
32 +
33 +# PHP 项目的编译产物提交到 Git 服务器
34 +cd $PHP_PATH
35 +git pull
36 +git add -A
37 +git commit -m '自定义表单-前端网页更新'
38 +git push
39 +
13 # 更新其他分支数据 40 # 更新其他分支数据
14 git checkout master 41 git checkout master
15 git pull origin master 42 git pull origin master
...@@ -36,3 +63,4 @@ ssh -p 22 itomix@ipadbiz.cn ' ...@@ -36,3 +63,4 @@ ssh -p 22 itomix@ipadbiz.cn '
36 ' 63 '
37 64
38 git checkout custom_form; 65 git checkout custom_form;
66 +rm -rf front
......