From 634ad82d2c5ffe56f1bda3399cb96edb88318ef8 Mon Sep 17 00:00:00 2001 From: khwezi Date: Sat, 14 Mar 2026 11:23:44 +0200 Subject: [PATCH] Unified docker commands --- .drone.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index 7a1cd15..7ae8713 100644 --- a/.drone.yml +++ b/.drone.yml @@ -134,12 +134,17 @@ steps: settings: settings: script: - - powershell -Command "if (!(Test-Path 'C:\Temp\docker-config')) { New-Item -Path 'C:\Temp\docker-config' -ItemType Directory }" - - powershell -Command "Set-Content -Path 'C:\Temp\docker-config\config.json' -Value '{\"credsStore\": \"\"}'" - - powershell -Command "docker --config C:\Temp\docker-config pull khwezi/webapitest:latest" - - powershell -Command "docker --config C:\Temp\docker-config stop webapi; exit 0" - - powershell -Command "docker --config C:\Temp\docker-config rm webapi; exit 0" - - powershell -Command "docker --config C:\Temp\docker-config run -d --name webapi --restart unless-stopped -e ASPNETCORE_ENVIRONMENT=Production -p 4001:8081 khwezi/webapitest:latest" + - | + powershell -Command " + $path = 'C:/Temp/docker-config'; + if (!(Test-Path $path)) { New-Item -Path $path -ItemType Directory -Force | Out-Null }; + $json = '{\"credsStore\": \"\"}'; + $json | Out-File -FilePath \"$path/config.json\" -Encoding ascii; + docker --config $path pull khwezi/webapitest:latest; + docker --config $path stop webapi 2>$null; + docker --config $path rm webapi 2>$null; + docker --config $path run -d --name webapi --restart unless-stopped -e ASPNETCORE_ENVIRONMENT=Production -p 4001:8081 khwezi/webapitest:latest; + " when: event: - promote -- 2.47.3