Refactored prod step #81
12
.drone.yml
12
.drone.yml
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user