publish: remove the images this job built after pushing them (noel/infra#2151) #23
Loading…
Reference in a new issue
No description provided.
Delete branch "claude/publish-image-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
publishjob (ci-protected) will also run on the shared trusted VM from noel/infra#2151 step 7, where Docker and its disk persist across jobs and the janitor only prunes dangling images. Each publish would leave its uniquely tagged image behind.scripts/publish-image.pynow runsdocker image rm <IMAGE:tag>for exactly the reference it built, after the push and deployment proposal, and also when the build, push or proposal fails (try/finally). Removal is best effort: a failure logs one line and never fails the job. Nothing else is pruned. The credential-free validate build gets the same cleanup.Tests:
python3 -B -m unittest discover -s scripts/tests -vpasses (39 tests, 1 skipped as before), including a new one for removal after push, after a failed push or build, and a failed removal that leaves the job green.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.