mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-09-30 15:03:12 +00:00
* feat(terraform): ship dev content CD through Terraform (SH-300) GitHub uploads immutable release prefixes; Terraform owns live publish. Push-to-dev stays off until TERRAFORM_CONTENT_CD_ENABLED is set. * fix(terraform): align release-plan guard flags and CloudFront verify IAM (SH-300)
23 lines
1.1 KiB
Bash
Executable file
23 lines
1.1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Print pointer body, origin paths, distribution status, and served index hash.
|
|
# Used by deploy.yml's always() summary. Never fails the job on a missing pointer.
|
|
set -u
|
|
DISTRIBUTION_ID="${DISTRIBUTION_ID:-E2CWLM1AFB964P}"
|
|
SITE_BUCKET="${SITE_BUCKET:-seahaven-shoc-frontend-dev}"
|
|
SITE_URL="${SITE_URL:-https://dev.seahaven.com}"
|
|
echo "=== CloudFront live state ==="
|
|
echo "pointer:"
|
|
aws s3 cp "s3://${SITE_BUCKET}/.release/current" - --only-show-errors 2>/dev/null || echo "(missing)"
|
|
echo
|
|
aws cloudfront get-distribution --id "${DISTRIBUTION_ID}" --output json | python3 -c '
|
|
import json, sys
|
|
payload = json.load(sys.stdin)
|
|
dist = payload.get("Distribution") or {}
|
|
config = dist.get("DistributionConfig") or {}
|
|
print("status:", dist.get("Status"))
|
|
for origin in ((config.get("Origins") or {}).get("Items") or []):
|
|
print("origin %s: origin_path=%r" % (origin.get("Id"), origin.get("OriginPath") or ""))
|
|
'
|
|
echo
|
|
echo -n "served index sha256: "
|
|
curl -fsS --max-time 30 "${SITE_URL}/" | python3 -c "import hashlib,sys; print(hashlib.sha256(sys.stdin.buffer.read()).hexdigest())" || echo "unreachable"
|