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>
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
# FlatRender V2 — run all schema migrations in order on first postgres init.
|
||||
# Mounted at: /docker-entrypoint-initdb.d/00-init.sh
|
||||
# Migrations dir mounted at: /migrations (read-only)
|
||||
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."
|
||||
Reference in New Issue
Block a user