forked from codecov/codecov-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.sh
executable file
·35 lines (31 loc) · 1.09 KB
/
dev.sh
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
29
30
31
32
33
34
35
#!/bin/bash
# starts the development server using gunicorn
# NEVER run production with the --reload option command
echo "Starting gunicorn in dev mode"
_start_gunicorn() {
if [ -n "$PROMETHEUS_MULTIPROC_DIR" ]; then
rm -r ${PROMETHEUS_MULTIPROC_DIR?}/* 2> /dev/null
mkdir -p "$PROMETHEUS_MULTIPROC_DIR"
fi
export PYTHONWARNINGS=always
suffix=""
if [[ "$STATSD_HOST" ]]; then
suffix="--statsd-host ${STATSD_HOST}:${STATSD_PORT}"
fi
if [ "$RUN_ENV" == "ENTERPRISE" ] || [ "$RUN_ENV" == "DEV" ]; then
python manage.py migrate
python manage.py migrate --database "timeseries" timeseries
python manage.py pgpartition --yes --skip-delete
fi
if [[ "$DEBUGPY" ]]; then
pip install debugpy
python -m debugpy --listen 0.0.0.0:12345 -m gunicorn codecov.wsgi:application --reload --bind 0.0.0.0:8000 --access-logfile '-' --timeout "${GUNICORN_TIMEOUT:-600}" $suffix
fi
gunicorn codecov.wsgi:application --reload --bind 0.0.0.0:8000 --access-logfile '-' --timeout "${GUNICORN_TIMEOUT:-600}" $suffix
}
if [ -z "$1" ];
then
_start_gunicorn
else
exec "$@"
fi