新增版本控制
This commit is contained in:
37
bluetti-tools-deploy.yaml
Normal file
37
bluetti-tools-deploy.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
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:
|
||||
- |
|
||||
echo ">>>>>> 开始准备配置文件 <<<<<<"
|
||||
cp /bluetti/frontend_project/bluetti-tools-configs/tools.production.env apps/web/.env
|
||||
echo ">>>>>> 开始构建镜像 <<<<<<"
|
||||
docker build -t bluetti-tools-web:latest -f Dockerfile .
|
||||
echo ">>>>>> 正在部署服务 <<<<<<"
|
||||
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