Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move migrations back into server.sh #2288

Merged
merged 1 commit into from Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions discovery-provider/scripts/dev-server.sh
@@ -1,6 +1,13 @@
#!/bin/bash
set -e

if [ "$audius_db_run_migrations" != false ]; then
echo "Running alembic migrations"
export PYTHONPATH='.'
alembic upgrade head
echo "Finished running migrations"
fi

# Audius Discovery Provider / Flask
# Exports environment variables necessary for Flask app

Expand Down
7 changes: 7 additions & 0 deletions discovery-provider/scripts/prod-server.sh
@@ -1,6 +1,13 @@
#!/bin/bash
set -e

if [ "$audius_db_run_migrations" != false ]; then
echo "Running alembic migrations"
export PYTHONPATH='.'
alembic upgrade head
echo "Finished running migrations"
fi

# Audius Discovery Provider / Gunicorn

# run with gunicorn web server in prod for greater performance and robustness
Expand Down
7 changes: 0 additions & 7 deletions discovery-provider/scripts/start.sh
Expand Up @@ -62,13 +62,6 @@ if [ -z "$audius_db_url" ]; then
/wait
fi

if [ "$audius_db_run_migrations" != false ]; then
echo "Running alembic migrations"
export PYTHONPATH='.'
alembic upgrade head
echo "Finished running migrations"
fi

if [[ "$audius_discprov_dev_mode" == "true" ]]; then
./scripts/dev-server.sh 2>&1 | tee >(logger -t server) server.log &
if [[ "$audius_no_workers" != "true" ]] && [[ "$audius_no_workers" != "1" ]]; then
Expand Down