Fix deploy script: compose run was eating the rest of the heredoc
The whole remote script is fed to `ssh bash -s` as stdin (a heredoc). `docker compose run` without -T attaches that stdin to the container, so it consumed every line after the migrate — web was never restarted and no health check ran, yet the script exited 0 and printed "Done". A deploy that half-ran and reported success. `-T` plus `</dev/null` on the migrate command stops it reading the heredoc. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -75,7 +75,10 @@ step "Starting db + redis"
|
|||||||
dc up -d db redis
|
dc up -d db redis
|
||||||
|
|
||||||
step "Running migrations"
|
step "Running migrations"
|
||||||
dc run --rm web python manage.py migrate --noinput
|
# -T and </dev/null are load-bearing: this whole script IS ssh's stdin (a heredoc), and
|
||||||
|
# `compose run` without them attaches that stdin to the container — swallowing every command
|
||||||
|
# below it, so web never restarts and the script exits 0 having done half the job.
|
||||||
|
dc run --rm -T web python manage.py migrate --noinput </dev/null
|
||||||
|
|
||||||
# Recreate only web, with the freshly built image. db and redis keep running untouched.
|
# Recreate only web, with the freshly built image. db and redis keep running untouched.
|
||||||
step "Restarting web"
|
step "Restarting web"
|
||||||
|
|||||||
Reference in New Issue
Block a user