Merge pull request 'Refactored prod step' (#81) from test into main
Reviewed-on: #81
This commit was merged in pull request #81.
This commit is contained in:
12
.drone.yml
12
.drone.yml
@@ -136,14 +136,24 @@ steps:
|
||||
script:
|
||||
- |
|
||||
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 };
|
||||
$json = '{\"credsStore\": \"\"}';
|
||||
$json | Out-File -FilePath \"$path/config.json\" -Encoding ascii;
|
||||
Write-Host 'Config file created.';
|
||||
|
||||
docker --config $path pull khwezi/webapitest:latest;
|
||||
|
||||
Write-Host 'Attempting to stop/remove container...';
|
||||
docker --config $path stop 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;
|
||||
|
||||
Write-Host 'Final container status:';
|
||||
docker ps -a --filter 'name=webapi';
|
||||
"
|
||||
when:
|
||||
event:
|
||||
|
||||
Reference in New Issue
Block a user