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:
+10
-1
@@ -1,6 +1,15 @@
|
|||||||
$image = "docker.stwaddle.com/budget:latest"
|
$image = "docker.stwaddle.com/budget:latest"
|
||||||
|
|
||||||
docker build -t $image .
|
docker build -t $image .
|
||||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||||
|
|
||||||
docker push $image
|
docker push $image
|
||||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
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 }
|
||||||
|
|||||||
Reference in New Issue
Block a user