部署备份
This commit is contained in:
35
bluetti-tools/drone.yaml
Normal file
35
bluetti-tools/drone.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: deploy-bluetti-web
|
||||
|
||||
steps:
|
||||
# 步骤 1: 挂载宿主机 Docker 和配置目录,直接构建并启动
|
||||
- name: build-and-deploy
|
||||
image: docker:24.0.7 # 或者使用 docker:dind
|
||||
volumes:
|
||||
- name: docker_sock
|
||||
path: /var/run/docker.sock # 联动宿主机 Docker
|
||||
- name: configs_dir
|
||||
path: /bluetti/frontend_project/bluetti-tools-configs # 映射宿主机配置目录
|
||||
commands:
|
||||
- |
|
||||
export DOCKER_BUILDKIT=1
|
||||
cp /bluetti/frontend_project/bluetti-tools-configs/tools.production.env apps/web/.env
|
||||
docker build --build-arg BUILDKIT_INLINE_CACHE=1 -t bluetti-tools-web:latest -f Dockerfile .
|
||||
docker compose down --remove-orphans
|
||||
docker compose up -d
|
||||
echo ">>>>>> 部署成功! <<<<<<"
|
||||
|
||||
volumes:
|
||||
- name: docker_sock
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
- name: configs_dir
|
||||
host:
|
||||
path: /bluetti/frontend_project/bluetti-tools-configs # 宿主机存放所有 .env 的绝对路径
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
Reference in New Issue
Block a user