Unified docker commands

This commit is contained in:
2026-03-14 11:23:44 +02:00
parent 59c08d2314
commit 634ad82d2c

View File

@@ -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