-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathboot
More file actions
executable file
·47 lines (36 loc) · 962 Bytes
/
boot
File metadata and controls
executable file
·47 lines (36 loc) · 962 Bytes
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
#!/usr/bin/env bash
#
# This script is designed to be run inside the container
#
# fail hard and fast even on pipelines
set -eo pipefail
# set debug based on envvar
[[ $DRYCC_DEBUG == "true" ]] && set -x
echo system information:
echo "Django Version: $(./manage.py --version)"
python --version
mkdir -p /app/data/logs
chmod -R 777 /app/data/logs
echo "Django checks:"
python /app/manage.py check --deploy api
echo ""
echo "Health Checks:"
python /app/manage.py healthchecks
echo ""
echo "Database Migrations:"
python /app/manage.py migrate --noinput
# spawn a gunicorn server in the background
echo ""
echo "Starting up Gunicorn"
gunicorn -c /app/drycc/gunicorn/config.py api.wsgi &
# smart shutdown on SIGTERM (SIGINT is handled by gunicorn)
function on_exit() {
GUNICORN_PID=$(cat /tmp/gunicorn.pid)
kill -TERM "$GUNICORN_PID" 2>/dev/null
wait "$GUNICORN_PID" 2>/dev/null
exit 0
}
trap on_exit TERM
echo ""
echo drycc-controller running...
wait