mirror of
https://github.com/Sea-Haven-Industries/forgejo.git
synced 2026-09-30 13:23:10 +00:00
* feat(terraform): migrate forgejo to HCP Terraform Move the prod host onto workspace forgejo-prod in the After Hours VPC and freeze CDK push deploys so cutover can happen without applying into seahaven-prod. * fix(terraform): restore forgejo.db from the dump tarball Boot restore was copying data/ and repos/ and leaving the sqlite file at the archive root, so a volume restore started Forgejo with no database.
22 lines
496 B
Bash
22 lines
496 B
Bash
#!/usr/bin/env bash
|
|
# Terraform external data source entrypoint. Stdout must be JSON only.
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "$0")" && pwd)"
|
|
bash "${ROOT}/build_lambda.sh" >&2
|
|
|
|
if command -v sha256sum >/dev/null 2>&1; then
|
|
SHA=(sha256sum)
|
|
else
|
|
SHA=(shasum -a 256)
|
|
fi
|
|
|
|
hash="$(
|
|
{
|
|
find -P "${ROOT}/build/function" -type f -print0 2>/dev/null \
|
|
| sort -z \
|
|
| xargs -0 "${SHA[@]}"
|
|
} | "${SHA[@]}" | awk '{print $1}'
|
|
)"
|
|
|
|
printf '{"status":"ok","hash":"%s"}\n' "${hash}"
|