Browse Source

refactor: 🛠️ 优化 Drone CI 配置,移除调试命令,确保配置文件路径一致

pull/30/head
chenjiale 1 month ago
parent
commit
ce8ca07b25
  1. 19
      .drone.yml

19
.drone.yml

@ -19,26 +19,27 @@ steps:
- name: dockersock
path: /var/run/docker.sock
commands:
- echo "=== BUILD STAGE PWD ==="
- pwd
- ls -l
- docker build -t alert-python:latest -f Dockerfile .
- docker build --no-cache -t alert-python:latest -f Dockerfile .
- name: run python container
image: docker
volumes:
- name: dockersock
path: /var/run/docker.sock
- name: python-conf
path: /opt/alert/model-lab
commands:
- echo "=== RUN STAGE PWD ==="
- pwd
- ls -l
- test -f $(pwd)/config.py || (echo "config.py not found" && exit 1)
- mkdir -p /opt/alert/model-lab
- cp config.py /opt/alert/model-lab/config.py
- docker stop alert-python || true
- docker rm alert-python || true
- docker run -d --restart always --name alert-python --network alert-net -p 8082:8082 -v $(pwd)/config.py:/opt/alert/model-lab/config.py:ro -v $(pwd)/config.py:/app/config.py:ro alert-python:latest
- docker run -d --restart always --name alert-python --network alert-net -p 8082:8082 -v /opt/alert/model-lab/config.py:/opt/alert/model-lab/config.py:ro alert-python:latest
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
- name: python-conf
host:
path: /opt/alert/model-lab

Loading…
Cancel
Save