优化 shell 脚本
parent
a81fba1e77
commit
f182654366
|
@ -1,9 +1,9 @@
|
|||
|
||||
# 安装依赖包
|
||||
|
||||
cd admin-web
|
||||
cd mobile-web
|
||||
|
||||
cnpm install
|
||||
npm install
|
||||
|
||||
# 开始构建
|
||||
|
||||
|
@ -17,11 +17,11 @@ mkdir app
|
|||
|
||||
# 复制配置文件
|
||||
|
||||
cp -rf config/server app/
|
||||
cp -rf server app/
|
||||
|
||||
# npm 构建项目
|
||||
|
||||
npm run build:admin-web
|
||||
npm run build
|
||||
|
||||
# 复制文件到 server 努力
|
||||
|
||||
|
@ -29,16 +29,18 @@ cp -rf dist app/server
|
|||
|
||||
# 复制文件到 project 目录执行
|
||||
|
||||
if [ ! -d "/work2/project/admin-web/server/dist" ]; then
|
||||
rm -rf /work2/project/admin-web/server/dist
|
||||
if [ ! -d "/work2/project/mobile-web/server/dist" ]; then
|
||||
mkdir -pv /work2/project/mobile-web/server/dist
|
||||
else
|
||||
rm -rf /work2/project/mobile-web/server/dist
|
||||
fi
|
||||
|
||||
cp -rf app/server /work2/project/admin-web
|
||||
cp -rf app/server /work2/project/mobile-web
|
||||
|
||||
# 安装 server 依赖项
|
||||
cd /work2/project/admin-web/server
|
||||
cd /work2/project/mobile-web/server
|
||||
|
||||
cnpm install
|
||||
npm install
|
||||
|
||||
# 启动服务
|
||||
pm2 restart pm2.json
|
||||
|
|
Loading…
Reference in New Issue