From b82b3939ce706ebc81d9818592a7867734864a71 Mon Sep 17 00:00:00 2001 From: Spencer Twaddle <7374698+stwaddle@users.noreply.github.com> Date: Wed, 6 May 2026 22:22:10 -0500 Subject: [PATCH] Improve deploy script reliability Switch from explicit down/up to --pull always to avoid unnecessary network teardown. Add exit code check on SSH command and a post-deploy status check. Co-Authored-By: Claude Sonnet 4.6 --- deploy.ps1 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/deploy.ps1 b/deploy.ps1 index ab421fc..4543b85 100644 --- a/deploy.ps1 +++ b/deploy.ps1 @@ -1,6 +1,15 @@ $image = "docker.stwaddle.com/budget:latest" + docker build -t $image . if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + docker push $image if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } -ssh stwaddle_com "cd stwaddlecom; docker compose pull budget; docker compose down budget; docker compose up -d budget" \ No newline at end of file + +ssh stwaddle_com "cd stwaddlecom && docker compose up -d --pull always budget" +if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + +Write-Host "Waiting for container to start..." +Start-Sleep -Seconds 8 +ssh stwaddle_com "docker inspect --format='{{.State.Status}}' stwaddlecom-budget-1" +if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }