Files
rlz/.drone.yml

50 lines
1.0 KiB
YAML
Raw Normal View History

# Drone CI 配置 - RLZ 陪诊项目
# 触发条件: push 到 main 分支时自动构建并部署
# 需要先在 Gitea (http://101.43.95.130:3001) 的 Drone 中激活 admin/rlz 仓库
kind: pipeline
type: docker
name: rlz-deploy
trigger:
branch:
- main
event:
- push
steps:
# Step 1: 构建 Java 后端
- name: build-backend
image: maven:3.8-openjdk-8
commands:
- cd rlz
- mvn clean package -DskipTests
# Step 2: 构建 Docker 镜像并重启服务
- name: docker-deploy
image: docker:latest
volumes:
- name: docker_sock
path: /var/run/docker.sock
commands:
- cd rlz
- docker build -t rlz-backend:latest .
- cd ..
- docker compose up -d --build
depends_on:
- build-backend
# Step 3: 健康检查
- name: healthcheck
image: curlimages/curl:latest
commands:
- sleep 10
- curl -sS http://127.0.0.1:8039/captchaImage | head -c 120
depends_on:
- docker-deploy
volumes:
- name: docker_sock
host:
path: /var/run/docker.sock