From c43ce20bbe7cafd1fa9ce8acfa4d72c6e7a8092c Mon Sep 17 00:00:00 2001 From: khwezi Date: Sat, 14 Mar 2026 10:43:50 +0200 Subject: [PATCH] Added silent removal of existing containers --- .drone.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.drone.yml b/.drone.yml index 89a1b27..5c77191 100644 --- a/.drone.yml +++ b/.drone.yml @@ -107,6 +107,8 @@ steps: from_secret: ssh_password script: - docker pull khwezi/webapitest:latest + - docker stop webapi 2>NUL || echo "Container not running" + - docker rm webapi 2>NUL || echo "Container not found" - docker run -d --name webapi --restart unless-stopped -e ASPNETCORE_ENVIRONMENT=Development -p 4000:8081 khwezi/webapitest:latest --- @@ -132,6 +134,8 @@ steps: settings: script: - docker pull khwezi/webapitest:latest + - docker stop webapi 2>NUL || echo "Container not running" + - docker rm webapi 2>NUL || echo "Container not found" - docker run -d --name webapi --restart unless-stopped -e ASPNETCORE_ENVIRONMENT=Production -p 4001:8081 khwezi/webapitest:latest when: event: -- 2.47.3