mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Run migrations on the first web instance startup
This commit is contained in:
@@ -21,7 +21,7 @@ applications:
|
|||||||
- type: web
|
- type: web
|
||||||
instances: ((web_instances))
|
instances: ((web_instances))
|
||||||
memory: ((web_memory))
|
memory: ((web_memory))
|
||||||
command: ./scripts/run_app_paas.sh gunicorn -c ./gunicorn_config.py application
|
command: ./scripts/migrate_and_run_web.sh
|
||||||
- type: worker
|
- type: worker
|
||||||
instances: ((worker_instances))
|
instances: ((worker_instances))
|
||||||
memory: ((worker_memory))
|
memory: ((worker_memory))
|
||||||
|
|||||||
7
scripts/migrate_and_run_web.sh
Executable file
7
scripts/migrate_and_run_web.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ $CF_INSTANCE_INDEX -eq 0 ]]; then
|
||||||
|
flask db upgrade
|
||||||
|
fi
|
||||||
|
|
||||||
|
${HOME}/scripts/run_app_paas.sh gunicorn -c ${HOME}/gunicorn_config.py application
|
||||||
Reference in New Issue
Block a user