22 lines
638 B
Bash
22 lines
638 B
Bash
#!/bin/sh
|
|
# GoClaw Control Center entrypoint
|
|
# Runs Drizzle migrations before starting the server
|
|
|
|
set -e
|
|
|
|
echo "[Entrypoint] Running database migrations..."
|
|
|
|
# Run drizzle-kit migrate — applies all pending migrations idempotently
|
|
# drizzle.config.ts and drizzle/migrations/ are copied into /app during build
|
|
cd /app && node_modules/.bin/drizzle-kit migrate 2>&1
|
|
|
|
MIGRATE_EXIT=$?
|
|
if [ $MIGRATE_EXIT -ne 0 ]; then
|
|
echo "[Entrypoint] WARNING: Migration failed (exit $MIGRATE_EXIT). Starting server anyway..."
|
|
else
|
|
echo "[Entrypoint] Migrations applied successfully."
|
|
fi
|
|
|
|
echo "[Entrypoint] Starting server..."
|
|
exec node dist/index.js
|