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:
settings: settings:
script: 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 "
- powershell -Command "docker --config C:\Temp\docker-config pull khwezi/webapitest:latest" $path = 'C:/Temp/docker-config';
- powershell -Command "docker --config C:\Temp\docker-config stop webapi; exit 0" if (!(Test-Path $path)) { New-Item -Path $path -ItemType Directory -Force | Out-Null };
- powershell -Command "docker --config C:\Temp\docker-config rm webapi; exit 0" $json = '{\"credsStore\": \"\"}';
- 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" $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: when:
event: event:
- promote - promote