Showing
2 changed files
with
36 additions
and
1 deletions
publish.sh
0 → 100644
| 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 | ||
| 15 | + | ||
| 16 | +# 编译输出文件夹 | ||
| 17 | +output=voice | ||
| 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 | +# 更新SSH服务器上文件 | ||
| 36 | +ssh -p 22 itomix@ipadbiz.cn 'cd /opt/voice/f/voice && git pull' |
-
Please register or login to post a comment