-
Notifications
You must be signed in to change notification settings - Fork 3
/
boot
executable file
·39 lines (33 loc) · 857 Bytes
/
boot
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
#!/bin/bash
########################################
main_command="python3.6 run.py"
gworkers="4"
gserver="gunicorn -w $gworkers --bind 0.0.0.0:5000 run:app"
backup_path="backup/serious"
if [ "$1" == "restore" ]; then
# rethink
latest=`ls -1t $backup_path | head -1`
echo "$backup_path/$latest"
rethinkdb-restore -c rdb $backup_path/$latest
exit 0
fi
########################################
# Init variables
if [ "$1" == "devel" ]; then
APP_MODE='development'
elif [ "$APP_MODE" == "" ]; then
APP_MODE='production'
fi
# Select the right option
if [ "$APP_MODE" == "debug" ]; then
echo "[=== DEBUG MODE ===]"
sleep infinity
elif [ "$APP_MODE" == "production" ]; then
echo "Production !"
# GUNICORN
$gserver
else
echo "Development"
# API_DEBUG="true" $main_command
$main_command --debug
fi