Compare commits
1 commit
c3b906a9ed
...
adf824b33f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
adf824b33f |
1 changed files with 24 additions and 0 deletions
|
|
@ -235,6 +235,30 @@ if [ "$pull_ok" != 1 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# The daemon binary ships INSIDE the backend image, but infra and app images
|
||||||
|
# advance on different axes by design: this checkout tracks `main`, while image
|
||||||
|
# tags are env-staged (prod's come from `release`). So a host can legitimately
|
||||||
|
# be asked to roll a backend image OLDER than this compose file -- one built
|
||||||
|
# before the daemon existed and with no /usr/local/bin/thermograph-daemon in it.
|
||||||
|
# Creating the service anyway would leave a container crash-looping on a missing
|
||||||
|
# binary, on a deploy that otherwise succeeded. Probe the image we are actually
|
||||||
|
# about to roll and drop the daemon from this run if it can't support it; the
|
||||||
|
# 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
|
||||||
|
echo "==> $daemon_img predates the daemon binary; rolling without the daemon service this run"
|
||||||
|
kept=()
|
||||||
|
for t in "${TARGETS[@]}"; do
|
||||||
|
[ "$t" = daemon ] || kept+=("$t")
|
||||||
|
done
|
||||||
|
TARGETS=("${kept[@]}")
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Roll only the target service(s). Backend schema migrations run inside its own
|
# Roll only the target service(s). Backend schema migrations run inside its own
|
||||||
# entrypoint (alembic upgrade head) before uvicorn, so there's no separate
|
# entrypoint (alembic upgrade head) before uvicorn, so there's no separate
|
||||||
# migrate step; frontend is stateless.
|
# migrate step; frontend is stateless.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue