forgejo/terraform/build_lambda.sh
Adam Moussa 530bd7210e
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.
2026-09-29 18:36:17 -04:00

25 lines
754 B
Bash

#!/usr/bin/env bash
# Bundle the backup-verification function for the arm64 Lambda runtime.
# Runs on the Terraform worker during plan. HCP plan and apply use different
# workers, so the zip bytes are carried in the plan (see lambda.tf).
set -euo pipefail
ROOT="$(cd "$(dirname "$0")" && pwd)"
REPO="$(cd "${ROOT}/.." && pwd)"
SRC="${REPO}/lambda/backup-verification"
BUILD="${ROOT}/build/function"
rm -rf "${BUILD}"
mkdir -p "${BUILD}"
python3 -m pip install \
--target "${BUILD}" \
--platform manylinux2014_aarch64 \
--implementation cp \
--python-version 3.12 \
--only-binary=:all: \
--upgrade \
--requirement "${SRC}/requirements.txt"
cp "${SRC}/app.py" "${BUILD}/app.py"
find "${BUILD}" -type d -name __pycache__ -exec rm -rf {} +