-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathentrypoint.sh
executable file
·73 lines (65 loc) · 2.75 KB
/
entrypoint.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
set -e
/usr/local/bin/invoke update >> /usr/src/app/invoke.log
source $HOME/.bashrc
source $HOME/.override_env
echo DATABASE_URL=$DATABASE_URL
echo GEODATABASE_URL=$GEODATABASE_URL
echo SITEURL=$SITEURL
echo ALLOWED_HOSTS=$ALLOWED_HOSTS
echo GEOSERVER_PUBLIC_LOCATION=$GEOSERVER_PUBLIC_LOCATION
echo MONITORING_ENABLED=$MONITORING_ENABLED
echo MONITORING_HOST_NAME=$MONITORING_HOST_NAME
echo MONITORING_SERVICE_NAME=$MONITORING_SERVICE_NAME
echo MONITORING_DATA_TTL=$MONITORING_DATA_TTL
/usr/local/bin/invoke waitfordbs >> /usr/src/app/invoke.log
echo "waitfordbs task done"
# see issue https://github.com/celery/celery/issues/3200
# /usr/local/bin/invoke workaround >> /usr/src/app/invoke.log
# echo "workaround task done"
/usr/local/bin/invoke migrations >> /usr/src/app/invoke.log
echo "migrations task done"
/usr/local/bin/invoke prepare >> /usr/src/app/invoke.log
echo "prepare task done"
cmd="$@"
echo DOCKER_ENV=$DOCKER_ENV
if [ -z ${DOCKER_ENV} ] || [ ${DOCKER_ENV} = "development" ]
then
echo "Executing standard Django server $cmd for Development"
else
if [ ${IS_CELERY} = "true" ] || [ ${IS_CELERY} = "True" ]
then
cmd=$CELERY_CMD
echo "Executing Celery server $cmd for Production"
else
if [ ${IS_FIRST_START} = "true" ] || [ ${IS_FIRST_START} = "True" ] || [ ${FORCE_REINIT} = "true" ] || [ ${FORCE_REINIT} = "True" ]
then
/usr/local/bin/invoke fixtures >> /usr/src/app/invoke.log
echo "fixture task done"
/usr/local/bin/invoke updategeoip >> /usr/src/app/invoke.log
echo "updategeoip task done"
/usr/local/bin/invoke collectstatic >> /usr/src/app/invoke.log
echo "collectstatic task done"
/usr/local/bin/invoke waitforgeoserver >> /usr/src/app/invoke.log
echo "waitforgeoserver task done"
/usr/local/bin/invoke geoserverfixture >> /usr/src/app/invoke.log
echo "geoserverfixture task done"
/usr/local/bin/invoke monitoringfixture >> /usr/src/app/invoke.log
echo "monitoringfixture task done"
/usr/local/bin/invoke updateadmin >> /usr/src/app/invoke.log
echo "updateadmin task done"
else
/usr/local/bin/invoke collectstatic >> /usr/src/app/invoke.log
echo "collectstatic task done"
/usr/local/bin/invoke waitforgeoserver >> /usr/src/app/invoke.log
echo "waitforgeoserver task done"
/usr/local/bin/invoke geoserverfixture >> /usr/src/app/invoke.log
/usr/local/bin/invoke updateadmin >> /usr/src/app/invoke.log
echo "updateadmin task done"
fi
cmd=$UWSGI_CMD
echo "Executing UWSGI server $cmd for Production"
fi
fi
echo 'got command ${cmd}'
exec $cmd