yd-yunxing-server/.drone.yml

64 lines
1.7 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: build-jar
image: alpine
environment:
APP_VERSION: ${APP_VERSION}
volumes:
- name: build-output
path: /home/app/build
commands:
- mkdir -p /home/app/build/{gateway,system,infra}
- cp ruoyi-gateway/target/*.jar /home/app/build/gateway/app.jar
- cp ruoyi-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
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
- 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