Files
soroush.asadi 514cd3705f
CI/CD / CI · Web (tsc) (push) Successful in 1m8s
CI/CD / Deploy · full stack (push) Successful in 2m50s
ci(deploy): mount postgres init as a DIRECTORY (fix 'Is a directory')
The single-file bind mount ./scripts/init-db.sh left a stale empty dir in the
reused act_runner workspace → mounted as a directory → migrations never ran →
empty schemas → backend 28P01/connection failures. Move the init script to
deploy/postgres-initdb/00-init.sh and mount the whole DIR at
/docker-entrypoint-initdb.d (robust, like the migrations dir). Deploy checkout
now 'git clean -ffd' to purge stale workspace dirs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 21:39:15 +03:30

21 lines
723 B
Bash

#!/bin/bash
# FlatRender V2 — run all schema migrations in order on first postgres init.
# This whole directory is mounted at /docker-entrypoint-initdb.d (a DIRECTORY mount
# is robust; a single-file bind mount can leave a stale empty dir in a reused CI
# workspace → "Is a directory"). Migrations dir mounted read-only at /migrations.
set -e
MIGRATIONS_DIR="/migrations"
echo "==> FlatRender: running schema migrations from $MIGRATIONS_DIR"
for f in $(ls "$MIGRATIONS_DIR"/*.sql | sort); do
echo " Applying: $(basename "$f")"
psql -v ON_ERROR_STOP=1 \
--username "$POSTGRES_USER" \
--dbname "$POSTGRES_DB" \
--file "$f"
done
echo "==> FlatRender: all migrations applied."