yd-yunxing-server/.drone.yml

70 lines
1.9 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

kind: pipeline
type: docker
name: ${serverName} # 服务名成可与jar包名保持一致
steps:
- name: maven-build
image: maven:3.8.5-openjdk-17
volumes:
- name: maven-cache
path: /root/.m2
- name: build-output
path: /home/app/build
commands:
- mvn clean package -DskipTests=true -pl yudao-gateway,ruoyi-modules-system,yudao-module-infra -am
- name: build-jar
image: alpine
volumes:
- name: build-output
path: /home/app/build
commands:
- mkdir -p /home/app/build/{gateway,system,infra}
- cp yudao-gateway/target/*.jar /home/app/build/gateway/app.jar
- cp yudao-modules-system/target/*.jar /home/app/build/system/app.jar
- cp yudao-module-infra/target/*.jar /home/app/build/file/app.jar
- cp Dockerfile /home/app/build/
- name: build-docker
image: docker
volumes:
- name: build-output
path: /home/app/build
- name: docker
path: /var/run/docker.sock
commands:
- cd /home/app/build
- cd gateway && docker build -t ruoyi-gateway:${APP_VERSION} -f ../Dockerfile .
- cd ../system && docker build -t ruoyi-system:${APP_VERSION} -f ../Dockerfile .
- cd ../infra && docker build -t ruoyi-infra:${APP_VERSION} -f ../Dockerfile .
- name: deploy-with-compose
image: docker/compose:1.29.2
environment:
APP_VERSION: ${APP_VERSION}
volumes:
- name: build-output
path: /home/app/build
- name: docker
path: /var/run/docker.sock
commands:
- cd /home/app/build
- cp docker-compose.yml .
- sed -i "s/\${APP_VERSION}/${APP_VERSION}/g" docker-compose.yml
- docker-compose up -d
volumes:
- name: maven-cache
host:
path: /home/data/maven/cache
- name: docker
host:
path: /var/run/docker.sock
#trigger:
# event:
# - custom
# ref:
# - refs/tags/version1.1