Exit a release that is already live instead of promoting again

4f14c5d8f9eb · AtlantisPleb · · parent 696129384e96

Exit a release that is already live instead of promoting again

Re-running a release whose sha is already live fell through to a fresh
promotion: a new target, a new build, and a roll of a fleet already serving
exactly what was asked for. Nothing to do is a valid outcome, and it has to be
decided before anything is promoted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SoZMfWRSGnf6FZX2Ar9rQ2
Co-Authored-By
Claude Fable 5 <noreply@anthropic.com>

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

pushed
by user · WAL seq 421 · 2026-08-25T22:09:33.013261Z

Changed files

  • modified ops/deploy/release-to-production.sh

Diff

1 file changed, +16 -0

ops/deploy/release-to-production.sh modified +16

@@ -83,6 +83,22 @@ digest=$(gcloud artifacts docker images describe "$registry:$sha" \

83 83
[ -n "$digest" ] || { echo "no image for $sha; build it first" >&2; exit 1; }
84 84
echo "image digest: $digest"
85 85
86
# Nothing to do is a valid outcome, and it has to be checked before anything
87
# is promoted. A release already live on this sha used to fall through to a
88
# fresh promotion, which builds a new target and rolls a fleet that is already
89
# serving exactly what was asked for.
90
live_now=$(mktemp)
91
cat > "$live_now" <<ELIXIR
92
live = OpenAgents.Forge.Targets.live("openagents.com")
93
IO.puts(if live && live.sha == "$sha", do: "already-live", else: "roll-needed")
94
ELIXIR
95
if rpc_file sarah-fleet-1 us-central1-a "$live_now" 2>/dev/null | grep -q "already-live"; then
96
  rm -f "$live_now"
97
  echo "$sha is already live on this fleet; nothing to do"
98
  exit 0
99
fi
100
rm -f "$live_now"
101
86 102
echo "==> promote"
87 103
promote=$(mktemp)
88 104
cat > "$promote" <<ELIXIR

This page updates live while a promote is in flight · changelog