From ce8ca07b2576512a820c4b1af2a2c629ec278ddf Mon Sep 17 00:00:00 2001 From: chenjiale Date: Thu, 4 Dec 2025 14:13:23 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=9B=A0=EF=B8=8F=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20Drone=20CI=20=E9=85=8D=E7=BD=AE=EF=BC=8C=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E8=B0=83=E8=AF=95=E5=91=BD=E4=BB=A4=EF=BC=8C=E7=A1=AE?= =?UTF-8?q?=E4=BF=9D=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index 6e92f2e..8507c9e 100644 --- a/.drone.yml +++ b/.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 -- 2.30.2