Update stuff so we can pass build hopefully
Build and Push Next App / quality (push) Failing after 39s
Build and Push Next App / build-next (push) Has been skipped

This commit is contained in:
Gabriel Brown
2026-06-21 21:48:03 -05:00
parent 97d29200d3
commit c33d3cc02d
8 changed files with 94 additions and 125 deletions
+5
View File
@@ -8,5 +8,10 @@ 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
bunx 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
+52
View File
@@ -0,0 +1,52 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
GENERATED_DIR="$ROOT_DIR/packages/backend/convex/_generated"
if [[ -z "${CONVEX_SELF_HOSTED_URL:-}" ]]; then
if [[ -n "${CONVEX_URL:-}" ]]; then
export CONVEX_SELF_HOSTED_URL="$CONVEX_URL"
elif [[ -n "${NEXT_PUBLIC_CONVEX_URL:-}" ]]; then
export CONVEX_SELF_HOSTED_URL="$NEXT_PUBLIC_CONVEX_URL"
fi
fi
has_generated_files() {
[[ -f "$GENERATED_DIR/api.js" ]] \
&& [[ -f "$GENERATED_DIR/api.d.ts" ]] \
&& [[ -f "$GENERATED_DIR/server.js" ]] \
&& [[ -f "$GENERATED_DIR/server.d.ts" ]] \
&& [[ -f "$GENERATED_DIR/dataModel.d.ts" ]]
}
has_self_hosted_env() {
[[ -n "${CONVEX_SELF_HOSTED_URL:-}" ]] \
&& [[ -n "${CONVEX_SELF_HOSTED_ADMIN_KEY:-}" ]]
}
has_cloud_deployment_env() {
[[ -n "${CONVEX_DEPLOYMENT:-}" ]]
}
if has_self_hosted_env || has_cloud_deployment_env; then
cd "$ROOT_DIR/packages/backend"
bun run codegen
exit 0
fi
if has_generated_files; then
echo "Convex generated files already exist; skipping codegen because no deployment env is configured."
exit 0
fi
cat >&2 <<'EOF'
Convex generated files are missing.
Run this command with either:
- CONVEX_SELF_HOSTED_URL and CONVEX_SELF_HOSTED_ADMIN_KEY, or
- CONVEX_DEPLOYMENT
CI should provide these through its env file before running checks.
EOF
exit 1
+1
View File
@@ -5,5 +5,6 @@ ENVIRONMENT="${1:-staging}"
[[ "$ENVIRONMENT" == dev || "$ENVIRONMENT" == staging ]] || { echo "usage: update-next-app [dev|staging]" >&2; exit 2; }
ENV_FILE="$(mktemp)"; trap 'rm -f "$ENV_FILE"' EXIT
sh "$ROOT_DIR/scripts/export-env" "$ENVIRONMENT" > "$ENV_FILE"
bunx dotenv -e "$ENV_FILE" -- bash "$ROOT_DIR/scripts/convex-codegen"
docker compose --env-file "$ENV_FILE" -f "$ROOT_DIR/docker/compose.yml" build spoon-next
docker compose --env-file "$ENV_FILE" -f "$ROOT_DIR/docker/compose.yml" up -d spoon-next