Remove images from earlier deploys after a successful deploy #219

Merged
clawbot merged 2 commits from issue-216-remove-old-images into next2 2026-09-23 12:24:36 +02:00
2 Commits
Author SHA1 Message Date
sneak 4c6d3f464d Remove old images by tag, and test the step after a deploy (closes #216)
Check / check (pull_request) Skipped
Old images are now removed by their upaas-<app>:<N> tag, without force,
so Docker deletes an image only when no other tag (such as another app's
build of the same source) and no container still uses it. Removing by ID
with force could delete another app's rollback image.

The step after a deploy (record the new image, keep the replaced one for
rollback, remove the rest) is its own function, tested against a fake
Docker API, so the test fails if the removal is dropped or runs before
the images are updated.

Model: opus-5-5
2026-09-23 10:09:47 +00:00
sneak 8c61b5ae77 Remove images from earlier deploys after a successful deploy (closes #216)
After a successful deploy, upaas now removes the app's images other than
the one the running container uses and the previous one, which rollback
starts. Removing an image also removes the untagged images it was built on
unless another image still needs them. Images left by other stages of a
multi-stage build are not tied to the app and stay.

Model: opus-5-5
2026-09-23 10:05:02 +00:00