17 lines
412 B
Bash
17 lines
412 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
# Run migrations on every container start. Idempotent: alembic skips
|
|
# revisions already applied. Skipped for one-shot commands like `alembic`
|
|
# itself (would deadlock when explicitly invoked) and for the auth helper.
|
|
case "$1" in
|
|
alembic|python\ -m\ parser_bot.auth|/bin/sh|sh|bash)
|
|
exec "$@"
|
|
;;
|
|
esac
|
|
|
|
echo "[entrypoint] running alembic upgrade head"
|
|
alembic upgrade head
|
|
|
|
exec "$@"
|