Added silent removal of existing containers

This commit is contained in:
2026-03-14 10:43:50 +02:00
parent 26c90e1697
commit c43ce20bbe

View File

@@ -107,6 +107,8 @@ steps:
from_secret: ssh_password from_secret: ssh_password
script: script:
- docker pull khwezi/webapitest:latest - 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 - docker run -d --name webapi --restart unless-stopped -e ASPNETCORE_ENVIRONMENT=Development -p 4000:8081 khwezi/webapitest:latest
--- ---
@@ -132,6 +134,8 @@ steps:
settings: settings:
script: script:
- docker pull khwezi/webapitest:latest - 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 - docker run -d --name webapi --restart unless-stopped -e ASPNETCORE_ENVIRONMENT=Production -p 4001:8081 khwezi/webapitest:latest
when: when:
event: event: