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 <noreply@anthropic.com>
This commit is contained in:
Spencer Twaddle
2026-05-06 22:22:10 -05:00
parent ac3dcc2f31
commit b82b3939ce
+10 -1
View File
@@ -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"
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 }