SImplified prod docker step #82
39
.drone.yml
39
.drone.yml
@@ -124,37 +124,18 @@ clone:
|
|||||||
steps:
|
steps:
|
||||||
- name: prod
|
- name: prod
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
environment:
|
|
||||||
PLUGIN_USER:
|
|
||||||
from_secret: ssh_prod_user
|
|
||||||
PLUGIN_PASSWORD:
|
|
||||||
from_secret: ssh_prod_password
|
|
||||||
PLUGIN_HOST:
|
|
||||||
from_secret: ssh_prod_host
|
|
||||||
settings:
|
settings:
|
||||||
settings:
|
host:
|
||||||
|
from_secret: ssh_prod_host
|
||||||
|
username:
|
||||||
|
from_secret: ssh_prod_user
|
||||||
|
password:
|
||||||
|
from_secret: ssh_prod_password
|
||||||
script:
|
script:
|
||||||
- |
|
- docker --config C:/Temp/docker-config pull khwezi/webapitest:latest
|
||||||
powershell -Command "
|
- docker --config C:/Temp/docker-config stop webapi 2>$null || true
|
||||||
$path = 'C:/Users/Public/docker-config';
|
- docker --config C:/Temp/docker-config rm webapi 2>$null || true
|
||||||
Write-Host 'Checking path: ' $path;
|
- docker --config C:/Temp/docker-config run -d --name webapi --restart unless-stopped -e ASPNETCORE_ENVIRONMENT=Production -p 4001:8081 khwezi/webapitest:latest
|
||||||
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:
|
when:
|
||||||
event:
|
event:
|
||||||
- promote
|
- promote
|
||||||
|
|||||||
Reference in New Issue
Block a user