forked from GeoNode/geonode-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·58 lines (44 loc) · 1.33 KB
/
Copy pathentrypoint.sh
File metadata and controls
executable file
·58 lines (44 loc) · 1.33 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
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
#!/bin/bash
# Exit script in case of error
set -e
INVOKE_LOG_STDOUT=${INVOKE_LOG_STDOUT:-FALSE}
invoke () {
if [ "$INVOKE_LOG_STDOUT" = 'true' ] || [ "$INVOKE_LOG_STDOUT" = 'True' ]
then
/usr/local/bin/invoke $@
else
/usr/local/bin/invoke $@ > /usr/src/project/invoke.log 2>&1
fi
echo "$@ tasks done"
}
# Start cron service
service cron restart
echo $"\n\n\n"
echo "-----------------------------------------------------"
echo "STARTING DJANGO ENTRYPOINT $(date)"
echo "-----------------------------------------------------"
invoke update
source $HOME/.bashrc
source $HOME/.override_env
cmd="$@"
if [ "${IS_CELERY}" = "true" ] || [ "${IS_CELERY}" = "True" ]
then
echo "Executing Celery server $cmd for Production"
else
invoke migrations
invoke prepare
if [ "${FORCE_REINIT}" = "true" ] || [ "${FORCE_REINIT}" = "True" ] || [ ! -e "/mnt/volumes/statics/geonode_init.lock" ]; then
invoke fixtures
invoke initialized
invoke updateadmin
fi
invoke statics
invoke loadthesauri
echo "Executing UWSGI server $cmd for Production"
fi
echo "-----------------------------------------------------"
echo "FINISHED DJANGO ENTRYPOINT --------------------------"
echo "-----------------------------------------------------"
# Run the CMD
echo "got command $cmd"
exec $cmd