hookehuyr

更新发布脚本

1 +#!/usr/bin/env sh
2 +# -----------------------------------------------
3 +# Filename: publish.sh
4 +# Revision: 1.0
5 +# Date: 2022年5月20日
6 +# Author: Hooke
7 +# Description: **** 根据php项目相应特征书写项目发布流程
8 +# -----------------------------------------------
9 +
10 +# 当发生错误时中止脚本
11 +set -e
12 +
13 +# 本地Git服务器目录路径
14 +path=/Users/huyirui/program/itomix/git/isp/f/custom_form
15 +
16 +# 编译输出文件夹
17 +output=front
18 +
19 +# 打包
20 +npm run build
21 +
22 +# 移除Git服务器目录下项目文件夹
23 +rm -r $path"/${output:?}"
24 +
25 +# 把本地编译输出文件夹添加到服务器目录
26 +mv "${output:?}/" $path
27 +
28 +# 提交到Git服务器
29 +cd $path"/${output:?}"
30 +git pull
31 +git add -A
32 +git commit -m '自定义表单-前端网页更新'
33 +git push
34 +
35 +git checkout develop;
36 +git pull origin develop;
37 +git merge --no-edit custom_form;
38 +git push origin develop;
39 +
40 +# 更新SSH服务器上文件
41 +ssh -p 22 itomix@ipadbiz.cn '
42 + cd /opt/space-dev/;
43 + git pull origin develop;
44 +'
45 +
46 +git checkout custom_form;
1 +#!/usr/bin/env sh
2 +# -----------------------------------------------
3 +# Filename: publish.sh
4 +# Revision: 1.0
5 +# Date: 2022年5月20日
6 +# Author: Hooke
7 +# Description: **** 根据php项目相应特征书写项目发布流程
8 +# -----------------------------------------------
9 +
10 +# 当发生错误时中止脚本
11 +set -e
12 +
13 +# 更新其他分支数据
14 +git checkout master
15 +git pull origin master
16 +git merge --no-edit custom_form
17 +git push origin master
18 +
19 +git checkout guanzong
20 +git pull origin guanzong
21 +git merge --no-edit custom_form
22 +git push origin guanzong
23 +
24 +git checkout mituo
25 +git pull origin mituo
26 +git merge --no-edit custom_form
27 +git push origin mituo
28 +
29 +ssh -p 22 itomix@ipadbiz.cn '
30 + cd /opt/oa;
31 + git pull origin master;
32 + cd /opt/guanzong;
33 + git pull origin guanzong;
34 + cd /opt/mituo;
35 + git pull origin mituo;
36 +'
37 +
38 +git checkout custom_form;