Repository navigation
Fix set -e abort after a successful deploy - #1
Merged
Merged
Conversation
The prune step used (( pruned++ )), which evaluates to 0 on the first increment. Under set -e that is a non-zero status and aborted the script *after* the release had gone live and the ERR trap had been disarmed — so a completely successful deploy exited 1. CI caught it in the pruning integration test. The trailing [[ $pruned -gt 0 ]] && log had the same problem when nothing needed pruning. Also addressed the shellcheck findings that gated CI: - SC2155: split the readonly STAMP declaration from its assignment so a failing date(1) is not masked by the declaration's exit status. - SC2015: the rollback reload used A && B || true, which swallowed a genuinely failing reload command. Replaced with an explicit if that reports the failure instead of hiding it. - SC2012: replaced ls with find for the release listing. find -printf is GNU-only, so the basename is stripped with sed to match the portability already required by atomic_symlink.
RootX22
added a commit
that referenced
this pull request
Aug 23, 2026
(( pruned++ )) returns 1 when pruned is 0, and set -e killed the script right after the release had already gone live. also cleaned up the shellcheck stuff while i was in there.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI caught a real bug in the pruning step.
(( pruned++ ))evaluates to0on the first increment, which is exit status 1. Underset -ethat aborted the script after the release had gone live and the ERR trap had been disarmed — a fully successful deploy exited 1, which any CI pipeline would report as a failed deployment.[[ $pruned -gt 0 ]] && loghad the same failure mode when there was nothing to prune.Also fixes the three shellcheck findings gating CI:
readonly STAMP=$(date ...)masks date's exit statusA && B || trueswallowed a failing reload during rollbackif, reports the failurelsused to list releasesfind+sed(-printfis GNU-only)Verified locally: six consecutive deploys with
KEEP_RELEASES=3all exit 0, three releases retained,currentpoints at the newest.