mirror of
https://github.com/Sea-Haven-Industries/meal-order-manager.git
synced 2026-09-30 04:13:12 +00:00
Freeze SAM CD and add greenfield Terraform for seahaven-prod so HCP is the sole stack deploy path.
24 lines
603 B
Bash
Executable file
24 lines
603 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Terraform external data source entrypoint. Stdout must be JSON only.
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "$0")" && pwd)"
|
|
"${ROOT}/build_packages.sh" >&2
|
|
|
|
# sha256sum on Linux workers, shasum on macOS.
|
|
if command -v sha256sum >/dev/null 2>&1; then
|
|
SHA=(sha256sum)
|
|
else
|
|
SHA=(shasum -a 256)
|
|
fi
|
|
|
|
hash="$(
|
|
{
|
|
# -P: do not follow symlinks; only hash regular files under build/.
|
|
find -P "${ROOT}/build" -type f -print0 2>/dev/null \
|
|
| sort -z \
|
|
| xargs -0 "${SHA[@]}"
|
|
} | "${SHA[@]}" | awk '{print $1}'
|
|
)"
|
|
|
|
printf '{"status":"ok","hash":"%s"}\n' "${hash}"
|