Files
spoon/scripts/build-next-app
T
Gabriel Brown 48071d1afe
Build and Push Next App / quality (push) Successful in 1m41s
Build and Push Next App / build-next (push) Successful in 3m36s
Update stuff so we can pass build hopefully
2026-06-21 22:01:04 -05:00

18 lines
830 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
ENVIRONMENT="${1:-staging}"
[[ "$ENVIRONMENT" == dev || "$ENVIRONMENT" == staging ]] || { echo "usage: build-next-app [dev|staging]" >&2; exit 2; }
ENV_FILE="${CI_ENV_FILE:-}"
cleanup() { [[ -n "$ENV_FILE" && "$ENV_FILE" != "${CI_ENV_FILE:-}" ]] && rm -f "$ENV_FILE" || true; }
trap cleanup EXIT
if [[ -z "$ENV_FILE" && -z "${CI:-}" ]]; then ENV_FILE="$(mktemp)"; sh "$ROOT_DIR/scripts/export-env" "$ENVIRONMENT" > "$ENV_FILE"; fi
if [[ -n "$ENV_FILE" ]]; then
bun dotenv -e "$ENV_FILE" -- bash "$ROOT_DIR/scripts/convex-codegen"
else
bash "$ROOT_DIR/scripts/convex-codegen"
fi
args=(); [[ -z "$ENV_FILE" ]] || args+=(--env-file "$ENV_FILE")
docker compose "${args[@]}" -f "$ROOT_DIR/docker/compose.yml" build spoon-next