ci: fix prune self-exclusion quote so the just-built ci-<sha> is never deleted #135
No reviewers
Labels
No labels
architecture
backend
bug
ci
config
database
docker
documentation
duplicate
enhancement
frontend
help wanted
invalid
issue-25
issue-26
issue-42
issue-65
issue-67
issue-82
migrations
p0-critical
p1-high
p2-medium
p3-low
performance
quality
question
security
state-management
testing
timezone
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
fastie81/honbu-manager!135
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/prune-quote"
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?
Root cause of the recurring 'ci-: not found' deploy failures:
The prune step in the build job used single quotes:
so ${GITHUB_SHA} was never expanded and the just-built image tag was NEVER excluded from pruning. Because ci- tags sort alphabetically and the current SHA begins with a digit ('1' < 'c'), the freshly-pushed ci- was the FIRST candidate deleted when keeping the latest 5 -- so the deploy job (which depends on build) pulled an image that the same run's prune had just destroyed.
Fix: change to double quotes so the SHA expands and the just-pushed image is excluded:
Verified green on this branch: test 2m11s, lint 1m10s, build 2m0s.
The prune step used single quotes around '^ci-${GITHUB_SHA}$', so the current build's SHA was NEVER excluded from pruning. Because the just-built ci-<sha> tag sorts first alphabetically (1 < c), it was the first to be deleted when keeping the latest 5, causing the deploy job to fail with 'ci-<sha>: not found'. Changed to double quotes so ${GITHUB_SHA} expands and the just-pushed image is protected from pruning.