Files
hzdyjs/.drone.yml
T
zlwuandCursor dcd29040de ci: Drone 暂跳过 web,仅 tag 打包 backend 与 mobile-h5
测试机内存不足以完成 Vite 生产构建,web 后续另议。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-24 17:01:06 +08:00

57 lines
1.9 KiB
YAML

# 仅 tag 触发:顺序打包 backend / mobile-h5
# web 暂不在 CI 构建(测试机内存不足以跑 Vite 生产包),后续另议
# 产物:/root/hzdyjs-releases/<tag>/{backend,mobile-h5}-<tag>.*
# Maven 缓存:宿主机 /root/maven-repo → 容器 /maven-repo(由 runner DRONE_RUNNER_VOLUMES 注入)
# 发版目录:/root/hzdyjs-releases → /hzdyjs-releases(同上,勿在本文件重复挂载)
kind: pipeline
type: docker
name: package-prod
concurrency:
limit: 1
trigger:
event:
- tag
clone:
depth: 1
steps:
- name: package-backend
image: maven:3.9-eclipse-temurin-17
commands:
- set -eu
- echo "==> backend tag=${DRONE_TAG} commit=${DRONE_COMMIT}"
- test -n "${DRONE_TAG}"
- mkdir -p "/hzdyjs-releases/${DRONE_TAG}"
- cd backend
- |
mvn clean package -Pprod \
-Dmaven.test.skip=true \
-Dmaven.compiler.parameters=true \
-Dmaven.repo.local=/maven-repo
- test -f ruoyi-admin/target/ruoyi-admin.jar
- cp -v ruoyi-admin/target/ruoyi-admin.jar "/hzdyjs-releases/${DRONE_TAG}/backend-${DRONE_TAG}.jar"
- ls -lh "/hzdyjs-releases/${DRONE_TAG}/backend-${DRONE_TAG}.jar"
- name: package-mobile-h5
image: node:20-bookworm
environment:
NPM_CONFIG_REGISTRY: https://registry.npmmirror.com
commands:
- set -eu
- echo "==> mobile-h5 tag=${DRONE_TAG}"
- mkdir -p "/hzdyjs-releases/${DRONE_TAG}"
- corepack enable
- corepack prepare pnpm@9 --activate
- cd mobile
- pnpm config set registry https://registry.npmmirror.com
- pnpm install --frozen-lockfile
- pnpm run build
- test -d dist/build/h5
- tar -C dist/build/h5 -czf "/hzdyjs-releases/${DRONE_TAG}/mobile-h5-${DRONE_TAG}.tar.gz" .
- ls -lh "/hzdyjs-releases/${DRONE_TAG}/"
- ls -lh "/hzdyjs-releases/${DRONE_TAG}/mobile-h5-${DRONE_TAG}.tar.gz"