mirror of
https://github.com/Sea-Haven-Industries/seahaven-door-unlock-api.git
synced 2026-09-30 07:03:12 +00:00
* feat(terraform): add hcp terraform for prod door-unlock-api Move deploy off frozen CDK CD onto an HCP workspace that recreates the HTTP API, five Lambdas, disabled EventBridge rules, and alarms in seahaven-prod without a poller VPC. * docs(readme): link the door unlock api ops page * fix(terraform): invoke package build via bash HCP launches the external data source with bash, so the inner build script should not depend on the git executable bit.
25 lines
666 B
Bash
Executable file
25 lines
666 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)"
|
|
# artifacts.tf already launches this file with bash, so +x is not required
|
|
# here. Invoke the inner script the same way so HCP plan does not depend on
|
|
# the git executable bit.
|
|
bash "${ROOT}/build_packages.sh" >&2
|
|
|
|
if command -v sha256sum >/dev/null 2>&1; then
|
|
SHA=(sha256sum)
|
|
else
|
|
SHA=(shasum -a 256)
|
|
fi
|
|
|
|
hash="$(
|
|
{
|
|
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}"
|