From a901dd5dffae298883da001e4f99a0a4b7abca9d Mon Sep 17 00:00:00 2001 From: sin <2943460818@qq.com> Date: Sat, 16 Mar 2019 15:26:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20jenkins=20=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E7=9A=84=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-web/config/server/shell.sh | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/admin-web/config/server/shell.sh b/admin-web/config/server/shell.sh index 9c9274d81..5dc3deca7 100644 --- a/admin-web/config/server/shell.sh +++ b/admin-web/config/server/shell.sh @@ -1,24 +1,44 @@ # 安装依赖包 -cd mall - cd admin-web -npm install +cnpm install # 开始构建 -npm run build +#npm run build # 创建 app 运行目录 +rm -rf app + mkdir app # 复制配置文件 cp -rf config/server app/ +# npm 构建项目 + +npm run build:admin-web + # 复制文件到 server 努力 -cp -rf dist app/ +cp -rf dist app/server + +# 复制文件到 project 目录执行 + +if [ ! -d "/work2/project/admin-web/server/dist" ]; then + rm -rf /work2/project/admin-web/server/dist +fi + +cp -rf app/server /work2/project/admin-web + +# 安装 server 依赖项 +cd /work2/project/admin-web/server + +cnpm install + +# 启动服务 +pm2 restart pm2.json