持续集成:接入前端node_modules极速构建与全自动部署机制
This commit is contained in:
1 parent
a47ed27e42
commit
22520b12ee
1 file changed
+7
-4
+7
-4
@@ -38,9 +38,12 @@ build_frontend:
|
||||
- if: '$CI_COMMIT_BRANCH'
|
||||
script:
|
||||
- echo "=== 开始编译前端 build_ui ==="
|
||||
- export NODE_OPTIONS=--openssl-legacy-provider
|
||||
- export NODE_OPTIONS="--openssl-legacy-provider --dns-result-order=ipv4first"
|
||||
- cd build_ui
|
||||
- npm install --registry=https://registry.npmmirror.com
|
||||
- if [ ! -d "node_modules" ] && [ -d "/data2/wzb/tools/frontend-cache/node_modules" ]; then
|
||||
echo "使用服务器本地缓存的 node_modules";
|
||||
ln -sfn /data2/wzb/tools/frontend-cache/node_modules ./node_modules;
|
||||
fi
|
||||
- npm run build:prod
|
||||
- echo "=== 前端编译成功 ==="
|
||||
artifacts:
|
||||
@@ -57,10 +60,10 @@ deploy_production:
|
||||
- if: '$CI_COMMIT_BRANCH'
|
||||
script:
|
||||
- echo "=== 开始部署应用 ==="
|
||||
# 复制前端静态资源到发布目录
|
||||
# 部署前端静态资源到发布目录
|
||||
- rm -rf /data2/wzb/deploy/frontend/*
|
||||
- cp -r build_ui/dist/* /data2/wzb/deploy/frontend/
|
||||
# 复制后端 Jar 包并执行重启
|
||||
# 部署后端 Jar 包并执行平滑重启
|
||||
- cp RuoYi-Vue/ruoyi-admin/target/ruoyi-admin.jar /data2/wzb/deploy/backend/
|
||||
- bash /data2/wzb/deploy/restart-all.sh
|
||||
- echo "=== 部署与自检成功完成! ==="
|
||||
Reference in new issue
Block a user