fix: report only the retired services a host actually had
CI / check (pull_request) Successful in 17s

`docker rm -f` exits 0 for a container that does not exist, so the
"Removing retired services" step printed "removed container
netork-registry-1" on every deploy of every host, long after the
container was gone. That read as something recreating the registry
each time, and it would hide the one deploy that really removed it.

Check with `docker inspect` first, so only an existing container is
removed and reported. The volume branch needed nothing: `docker volume
rm` already fails for a missing volume.

Closes #7
This commit is contained in:
Christian Manivong committed 2026-10-08 15:22:48 +02:00
1 parent 1d8353046e
commit 1d99e401b9
3 files changed
+51 -2

No files matched your search

+2 -1
View File
@@ -87,7 +87,8 @@ started earlier pulls whatever image the registry held before, which is stale.
4. Reconciles `apt-cacher-ng` and `signal-api`: each is recreated only if its
definition changed. It never touches `postgres` or `redis`.
It then removes services netOrk no longer ships, container and volume, where a host
still has them: today the bundled `registry` (NetOrk/netork#763).
still has them: today the bundled `registry` (NetOrk/netork#763). It reports only
what it actually removed; on a host that was cleaned earlier it says nothing.
5. Verifies that the containers run exactly the image that was pulled. If they don't, the
deploy fails.
6. Records `REGISTRY_HOST` and `NETORK_VERSION` in `~/netork/.env`, so that a