#!/bin/sh # Pins every Co-Lite image in the prod overlay to one commit SHA of main (openspec spec cluster-deployment). # Roll back by running it with the previous SHA and applying again. # deploy/set-release.sh <40-character commit sha> set -eu cd "$(dirname "$0")/.." sha=${1:-} printf '%s' "$sha" | grep -Eq '^[0-9a-f]{40}$' || { echo "usage: $0 <40-character commit sha of main>" >&2; exit 2; } k=deploy/k8s/overlays/prod/kustomization.yaml sed -i -E "s/^( newTag: )\"[0-9a-f]+\"$/\1\"$sha\"/" "$k" n=$(grep -c "^ newTag: \"$sha\"$" "$k") [ "$n" -eq 10 ] || { echo "set-release: expected 10 images at $sha, found $n" >&2; exit 1; } echo "prod overlay now pins all 10 images to $sha"