deploy.sh: fix the daemon-binary probe, which always dropped daemon #33

Merged
admin_emi merged 1 commit from fix-daemon-probe into main 2026-07-24 04:03:27 +00:00
Showing only changes of commit cf0fa01892 - Show all commits

View file

@ -247,9 +247,17 @@ fi
# next deploy of a tag that has it picks it up with no further action. # next deploy of a tag that has it picks it up with no further action.
case " ${TARGETS[*]} " in case " ${TARGETS[*]} " in
*" daemon "*) *" daemon "*)
daemon_img="$(docker compose config --images daemon 2>/dev/null | head -1 || true)" # Built directly from the same vars docker-compose.yml's `daemon.image:`
if [ -n "$daemon_img" ] \ # interpolates (REGISTRY_HOST/BACKEND_IMAGE_PATH/BACKEND_IMAGE_TAG),
&& ! docker run --rm --entrypoint sh "$daemon_img" -c 'test -x /usr/local/bin/thermograph-daemon' 2>/dev/null; then # NOT via `docker compose config --images daemon`: that command does not
# actually filter to the named service (confirmed live on Compose
# v5.3.1 -- it prints every service's image, one per line, in file
# order) so `| head -1` silently grabbed db's image instead. The probe
# then always found no daemon binary in a Postgres image and dropped
# daemon from EVERY backend deploy, regardless of what the real backend
# image contained -- reproduced and confirmed against beta directly.
daemon_img="${REGISTRY_HOST:-git.thermograph.org}/${BACKEND_IMAGE_PATH:-emi/thermograph/backend}:${BACKEND_IMAGE_TAG}"
if ! docker run --rm --entrypoint sh "$daemon_img" -c 'test -x /usr/local/bin/thermograph-daemon' 2>/dev/null; then
echo "==> $daemon_img predates the daemon binary; rolling without the daemon service this run" echo "==> $daemon_img predates the daemon binary; rolling without the daemon service this run"
kept=() kept=()
for t in "${TARGETS[@]}"; do for t in "${TARGETS[@]}"; do