Merge pull request 'SImplified prod docker step' (#82) from test into main
Reviewed-on: #82
This commit was merged in pull request #82.
This commit is contained in:
39
.drone.yml
39
.drone.yml
@@ -124,37 +124,18 @@ clone:
|
||||
steps:
|
||||
- name: prod
|
||||
image: appleboy/drone-ssh
|
||||
environment:
|
||||
PLUGIN_USER:
|
||||
from_secret: ssh_prod_user
|
||||
PLUGIN_PASSWORD:
|
||||
from_secret: ssh_prod_password
|
||||
PLUGIN_HOST:
|
||||
settings:
|
||||
host:
|
||||
from_secret: ssh_prod_host
|
||||
settings:
|
||||
settings:
|
||||
username:
|
||||
from_secret: ssh_prod_user
|
||||
password:
|
||||
from_secret: ssh_prod_password
|
||||
script:
|
||||
- |
|
||||
powershell -Command "
|
||||
$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';
|
||||
"
|
||||
- docker --config C:/Temp/docker-config pull khwezi/webapitest:latest
|
||||
- docker --config C:/Temp/docker-config stop webapi 2>$null || true
|
||||
- docker --config C:/Temp/docker-config rm webapi 2>$null || true
|
||||
- docker --config C:/Temp/docker-config run -d --name webapi --restart unless-stopped -e ASPNETCORE_ENVIRONMENT=Production -p 4001:8081 khwezi/webapitest:latest
|
||||
when:
|
||||
event:
|
||||
- promote
|
||||
|
||||
Reference in New Issue
Block a user