This commit is contained in:
XinWei 2024-08-22 17:14:13 +08:00
parent 9ca2bb3491
commit 3177130523

View File

@ -1,61 +1,47 @@
kind: pipeline # 定义对象类型还有secret和signature两种类型 kind: pipeline
type: docker
type: docker # 定义流水线类型还有kubernetes、exec、ssh等类型 name: microservice-build
name: filesystem-drone # 定义流水线名称
steps: # 定义流水线执行步骤,这些步骤将顺序执行
- name: font-build
image: node:18.18.0 # 定义全局环境变量
environment:
volumes: SERVICE: ${DRONE_SERVICE}
- name: build-font
path: /build/dist-prod
steps:
- name: build-service
image: maven:3-jdk-8
commands: commands:
- echo "Building Service: ${SERVICE}"
- |
if [ "${SERVICE}" = "gateway-service" ]; then
echo "Building Gateway Service..."
- cd yudao-admin-vue3 elif [ "${SERVICE}" = "system-service" ]; then
echo "Building System Service..."
- npm install --registry=https://registry.npmmirror.com/ else
echo "Building All Services..."
- npm run build:prod # 如果有其他服务,可以在这里继续添加
fi
- ls - name: test-service
image: maven:3-jdk-8
commands:
- echo "Testing Service: ${SERVICE}"
- |
if [ "${SERVICE}" = "gateway-service" ]; then
echo "Testing Gateway Service..."
- cp -r dist-prod/. /build/dist-prod elif [ "${SERVICE}" = "system-service" ]; then
echo "Testing System Service..."
- cd .. else
echo "Testing All Services..."
# 如果有其他服务,可以在这里继续添加
- name: copy package fi
image: appleboy/drone-ssh # SSH工具镜像
settings:
host: 101.43.112.107 # 远程连接地址
username: root # 远程连接账号
password:
from_secret: ssh_password # 从Secret中读取SSH密码
port: 22 # 远程连接端口
command_timeout: 5m # 远程执行命令超时时间
script:
- scp -r /zymail/font/dist-prod root@1.14.205.126:/root/zyEjmall/zyEj-admin-vue3
parameters:
SERVICE:
volumes: # 定义流水线挂载目录,用于共享数据 description: "The service to build and test. Leave empty to build and test all services."
default: ""
- name: build-font
host:
path: /zymail/font/dist-prod # 从宿主机中挂载的目录