- Definition of extra eveai_ops service to run (db) jobs
- Definition of manifests for all jobs - Definition of manifests for all eveai services
This commit is contained in:
20
scripts/dbops/03-db-migrate-public.sh
Executable file
20
scripts/dbops/03-db-migrate-public.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
log() { echo "[$(date -u +'%Y-%m-%dT%H:%M:%SZ')] $*"; }
|
||||
fail() { echo "ERROR: $*" >&2; exit 1; }
|
||||
|
||||
# Env requirements
|
||||
REQUIRED_VARS=(DB_HOST DB_PORT DB_NAME DB_USER DB_PASS)
|
||||
for v in "${REQUIRED_VARS[@]}"; do : "${!v:?$v required}"; done
|
||||
|
||||
export PROJECT_DIR="${PROJECT_DIR:-/app}"
|
||||
export FLASK_APP="${FLASK_APP:-${PROJECT_DIR}/scripts/run.py}"
|
||||
export COMPONENT_NAME="${COMPONENT_NAME:-eveai_app}"
|
||||
export PYTHONPATH="${PYTHONPATH:-${PROJECT_DIR}:${PYTHONPATH-}}"
|
||||
|
||||
export PGPASSWORD="$DB_PASS"
|
||||
|
||||
log "Applying Alembic migrations to the public schema..."
|
||||
flask db upgrade -d "${PROJECT_DIR}/migrations/public"
|
||||
log "Finished applying migrations to the public schema."
|
||||
Reference in New Issue
Block a user