From 5dff86c4fa77f1b350977ce273595644cc5de4f5 Mon Sep 17 00:00:00 2001 From: khwezi Date: Sat, 14 Mar 2026 11:41:25 +0200 Subject: [PATCH] SImplified prod docker step --- .drone.yml | 39 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9eedba0..dc5e881 100644 --- a/.drone.yml +++ b/.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: - from_secret: ssh_prod_host settings: - settings: + host: + from_secret: ssh_prod_host + 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