Merge pull request 'Refactored prod step' (#81) from test into main
All checks were successful
continuous-integration/drone Build is passing
continuous-integration/drone/promote/prod Build is passing

Reviewed-on: #81
This commit was merged in pull request #81.
This commit is contained in:
2026-03-14 11:34:09 +02:00

View File

@@ -136,14 +136,24 @@ steps:
script: script:
- | - |
powershell -Command " powershell -Command "
$path = 'C:/Temp/docker-config'; $path = 'C:/Users/Public/docker-config';
Write-Host 'Checking path: ' $path;
if (!(Test-Path $path)) { New-Item -Path $path -ItemType Directory -Force | Out-Null }; if (!(Test-Path $path)) { New-Item -Path $path -ItemType Directory -Force | Out-Null };
$json = '{\"credsStore\": \"\"}'; $json = '{\"credsStore\": \"\"}';
$json | Out-File -FilePath \"$path/config.json\" -Encoding ascii; $json | Out-File -FilePath \"$path/config.json\" -Encoding ascii;
Write-Host 'Config file created.';
docker --config $path pull khwezi/webapitest:latest; docker --config $path pull khwezi/webapitest:latest;
Write-Host 'Attempting to stop/remove container...';
docker --config $path stop webapi 2>$null; docker --config $path stop webapi 2>$null;
docker --config $path rm webapi 2>$null; docker --config $path rm webapi 2>$null;
Write-Host 'Starting container...';
docker --config $path run -d --name webapi --restart unless-stopped -e ASPNETCORE_ENVIRONMENT=Production -p 4001:8081 khwezi/webapitest:latest; docker --config $path run -d --name webapi --restart unless-stopped -e ASPNETCORE_ENVIRONMENT=Production -p 4001:8081 khwezi/webapitest:latest;
Write-Host 'Final container status:';
docker ps -a --filter 'name=webapi';
" "
when: when:
event: event: