-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathentrypoint
More file actions
executable file
·28 lines (21 loc) · 1.16 KB
/
entrypoint
File metadata and controls
executable file
·28 lines (21 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /usr/bin/env bash
set -e
RUN_COMMAND="talisker.gunicorn.gevent webapp.app:app --bind $1 --worker-class gevent --name talisker-`hostname`"
echo "Running alembic migrations"
alembic upgrade head
# Only run placeholder data import in development mode
if [ "${FLASK_DEBUG,,}" = "true" ] || [ "${FLASK_DEBUG}" = "True" ] || [ "${FLASK_DEBUG}" = "1" ] || [ "${FLASK_DEBUG}" = "yes" ]; then
echo "Running placeholder data import"
# Check if we should use dynamic or static placeholder data
if [ "${PLACEHOLDER_DATA_DYNAMIC,,}" = "true" ] || [ "${PLACEHOLDER_DATA_DYNAMIC}" = "True" ] || [ "${PLACEHOLDER_DATA_DYNAMIC}" = "1" ] || [ "${PLACEHOLDER_DATA_DYNAMIC}" = "yes" ]; then
echo "Using dynamically generated placeholder data"
python3 scripts/import-dynamic-placeholder-data.py
else
echo "Using static placeholder data from JSON files"
python3 scripts/import-static-placeholder-data.py
fi
fi
if [ "${FLASK_DEBUG,,}" = "true" ] || [ "${FLASK_DEBUG}" = "True" ] || [ "${FLASK_DEBUG}" = "1" ] || [ "${FLASK_DEBUG}" = "yes" ]; then
RUN_COMMAND="${RUN_COMMAND} --reload --log-level debug --timeout 9999"
fi
${RUN_COMMAND}