Files
probably-rendering-one-more…/scripts/release-mode.sh
T
codex-bot b67574f950
PROMPT Docker CI and deployment / verify-and-deploy (push) Successful in 5m36s
Add cached Web-only releases through existing Docker runtime
2026-10-23 19:45:26 +08:00

21 lines
822 B
Bash

#!/usr/bin/env bash
set -Eeuo pipefail
# Compare to what is running, not HEAD^: include failed or skipped releases.
ROOT=${PROMPT_ROOT:-/opt/prompt}
BASE=${1:-}
if [ -z "$BASE" ] && [ -f "$ROOT/current/release.env" ]; then
BASE=$(sed -n 's/^RELEASE_SHA=//p' "$ROOT/current/release.env")
fi
if ! [[ "$BASE" =~ ^[0-9a-f]{40}$ ]] || ! git cat-file -e "$BASE^{commit}" 2>/dev/null; then echo full; exit; fi
if ! git merge-base --is-ancestor "$BASE" HEAD; then echo full; exit; fi
CHANGED=0
while IFS= read -r -d '' file; do
CHANGED=1
case "$file" in
src/pages/api/*) echo full; exit;;
src/pages/*|src/components/*|src/styles/*|src/content/skills/*|public/*) ;;
*) echo full; exit;;
esac
done < <(git diff --no-renames --name-only -z "$BASE" HEAD)
if [ "$CHANGED" -eq 0 ]; then echo full; else echo web; fi