deploy.sh: fix the daemon-binary probe, which always dropped daemon (#33)
docker compose config --images daemon does not filter to the named service on this host's Compose v5.3.1 -- it prints every service's image, one per line, in file order, so `| head -1` was silently grabbing db's image (timescaledb) instead of daemon's. The probe then always found no /usr/local/bin/thermograph-daemon in a Postgres image and dropped daemon from every backend deploy, regardless of what the real backend image contained. Fixed by building the image reference directly from the same vars docker-compose.yml's daemon.image: already interpolates, instead of going through docker compose config at all. Reproduced against beta directly: the old sequence selected the wrong image; the new construction resolves correctly and the binary probe passes.
This commit is contained in:
parent
b83bfdbd67
commit
979653f407
1 changed files with 11 additions and 3 deletions
|
|
@ -247,9 +247,17 @@ fi
|
|||
# next deploy of a tag that has it picks it up with no further action.
|
||||
case " ${TARGETS[*]} " in
|
||||
*" daemon "*)
|
||||
daemon_img="$(docker compose config --images daemon 2>/dev/null | head -1 || true)"
|
||||
if [ -n "$daemon_img" ] \
|
||||
&& ! docker run --rm --entrypoint sh "$daemon_img" -c 'test -x /usr/local/bin/thermograph-daemon' 2>/dev/null; then
|
||||
# Built directly from the same vars docker-compose.yml's `daemon.image:`
|
||||
# interpolates (REGISTRY_HOST/BACKEND_IMAGE_PATH/BACKEND_IMAGE_TAG),
|
||||
# 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"
|
||||
kept=()
|
||||
for t in "${TARGETS[@]}"; do
|
||||
|
|
|
|||
Loading…
Reference in a new issue