Files
zkxw/.drone.yml
T

74 lines
2.0 KiB
YAML

# zkxw:仅编译打包,不自动部署测试环境
# 触发:push / tag
# 机器内存约 3.6G:分步构建 + 限制 Node 堆
kind: pipeline
type: docker
name: build-package
concurrency:
limit: 1
trigger:
event:
- push
- tag
# 使用本机已预拉的 drone/git(默认 clone 镜像)
clone:
depth: 1
steps:
- name: build-web-admin
image: node:20-bookworm
environment:
NODE_OPTIONS: --max-old-space-size=3072
commands:
- set -eu
- cp web-admin/.env.docker web-admin/.env.test
- corepack enable
- corepack prepare pnpm@9.15.9 --activate
- cd web-admin
- pnpm install --frozen-lockfile
# 降低并行以减轻内存峰值
- NODE_OPTIONS=--max-old-space-size=3072 pnpm exec vite build --mode test
- cd ..
- mkdir -p artifacts
- tar -C web-admin -czf artifacts/web-admin-dist.tar.gz dist
- sha256sum artifacts/web-admin-dist.tar.gz
- ls -lh artifacts/web-admin-dist.tar.gz
- name: build-oa-h5
image: node:20-bookworm
environment:
NODE_OPTIONS: --max-old-space-size=1024
commands:
- set -eu
- cp mobile-oa-h5/.env.docker mobile-oa-h5/.env.test
- cd mobile-oa-h5
- npm ci
- npm run build -- --mode test
- cd ..
- mkdir -p artifacts
- tar -C mobile-oa-h5 -czf artifacts/oa-h5-dist.tar.gz dist
- sha256sum artifacts/oa-h5-dist.tar.gz
- ls -lh artifacts/oa-h5-dist.tar.gz
- name: package-backend
image: node:20-bookworm
commands:
- set -eu
- mkdir -p artifacts
- |
tar -czf artifacts/backend-src.tar.gz \
--exclude='backend/.venv' \
--exclude='backend/venv' \
--exclude='backend/__pycache__' \
--exclude='backend/**/__pycache__' \
--exclude='backend/logs' \
--exclude='backend/.pytest_cache' \
--exclude='backend/graphify-out' \
backend
- sha256sum artifacts/backend-src.tar.gz
- ls -lh artifacts/backend-src.tar.gz