ludu-cloud/mobile-web/server/shell.sh

47 lines
625 B
Bash
Raw Normal View History

2019-03-26 13:18:53 +08:00
# 安装依赖包
2019-03-26 18:00:47 +08:00
cd mobile-web
2019-03-26 13:18:53 +08:00
2019-03-26 18:00:47 +08:00
npm install
2019-03-26 13:18:53 +08:00
# 开始构建
#npm run build
# 创建 app 运行目录
rm -rf app
mkdir app
# 复制配置文件
2019-03-26 18:00:47 +08:00
cp -rf server app/
2019-03-26 13:18:53 +08:00
# npm 构建项目
2019-03-26 18:00:47 +08:00
npm run build
2019-03-26 13:18:53 +08:00
# 复制文件到 server 努力
cp -rf dist app/server
# 复制文件到 project 目录执行
2019-03-26 18:00:47 +08:00
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
2019-03-26 13:18:53 +08:00
fi
2019-03-26 18:00:47 +08:00
cp -rf app/server /work2/project/mobile-web
2019-03-26 13:18:53 +08:00
# 安装 server 依赖项
2019-03-26 18:00:47 +08:00
cd /work2/project/mobile-web/server
2019-03-26 13:18:53 +08:00
2019-03-26 18:00:47 +08:00
npm install
2019-03-26 13:18:53 +08:00
# 启动服务
pm2 restart pm2.json