yinzy_dev #35

Merged
jk_yinzy merged 4 commits from yinzy_dev into main 2025-12-08 16:08:48 +08:00
Showing only changes of commit 8264c16dbf - Show all commits

View File

@ -17,6 +17,8 @@ workspace:
volumes:
- name: maven-cache
path: /localcache/maven/repository
- name: node-cache
path: /localcache/node_modules
clone:
depth: 0
@ -53,6 +55,19 @@ steps:
- mvn -s ~/.m2/settings.xml clean test package
- ls -lah target/*.jar || (echo "JAR file not found!" && exit 1)
- name: frontend-build
image: node:20
pull: false
volumes:
- name: node-cache
path: /localcache/node_modules
commands:
- cd vue-ui
- npm config set cache /localcache/node_modules/.npm
- npm ci --registry=https://registry.npmmirror.com
- npm run build
- ls -lah dist
# 如需其他检查步骤,可在这里继续追加
- name: summary
image: alpine
@ -86,6 +101,8 @@ volumes:
path: /var/run/docker.sock
- name: jar-cache
path: /localcache
- name: node-cache
path: /localcache/node_modules
clone:
depth: 0
@ -93,6 +110,23 @@ clone:
pull: false
steps:
- name: frontend-build
image: node:20
pull: false
volumes:
- name: node-cache
path: /localcache/node_modules
- name: jar-cache # 复用已有 /localcache用于暂存 dist.zip
path: /localcache
commands:
- cd vue-ui
- npm config set cache /localcache/node_modules/.npm
- npm ci --registry=https://registry.npmmirror.com
- npm run build
- cd dist && zip -r ../dist.zip . && cd ..
- mkdir -p /localcache/${DRONE_REPO_NAME}
- cp dist.zip /localcache/${DRONE_REPO_NAME}/dist-${DRONE_TAG}.zip
- name: java-build
image: registry.cn-beijing.aliyuncs.com/yinzy/maven:3.9-eclipse-temurin-8
pull: false
@ -134,6 +168,20 @@ steps:
echo "⚠️ No JAR file found to backup"
fi
- name: frontend_docker_build
image: docker:latest
pull: false
volumes:
- name: docker_sock
path: /var/run/docker.sock
commands:
- docker info
- docker build -t ${DRONE_REPO_NAME}-frontend:latest -f vue-ui/Dockerfile vue-ui
- docker tag ${DRONE_REPO_NAME}-frontend:latest ${DRONE_REPO_NAME}-frontend:${DRONE_COMMIT_SHA:0:8}
- docker images ${DRONE_REPO_NAME}-frontend
depends_on:
- frontend-build
- name: docker_build
image: docker:latest
pull: false
@ -169,6 +217,7 @@ steps:
from_secret: gitea_base_url
files:
- /localcache/${DRONE_REPO_NAME}/*.jar
- /localcache/${DRONE_REPO_NAME}/dist-${DRONE_TAG}.zip
title: Release ${DRONE_TAG}
note: |
Release ${DRONE_TAG}