-
Notifications
You must be signed in to change notification settings - Fork 25
/
entrypoint.sh
executable file
·69 lines (66 loc) · 1.73 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
#!/bin/bash
CONCURRENCY=${CONCURRENCY:-4}
# Define a common command prefix
WORKER_CMD="celery --quiet -A run_celery.notify_celery worker --logfile=/dev/null --concurrency=$CONCURRENCY"
COMMON_CMD="$WORKER_CMD -Q"
case "$1" in
worker)
exec $WORKER_CMD
;;
api)
exec gunicorn -c /home/vcap/app/gunicorn_config.py application
;;
api-local)
exec flask run --host 0.0.0.0 --port $PORT
;;
migration)
exec flask db upgrade
;;
functional-test-fixtures)
exec flask command functional-test-fixtures
;;
api-worker-retry-tasks)
exec $COMMON_CMD retry-tasks
;;
api-worker-letters)
exec $COMMON_CMD create-letters-pdf-tasks,letter-tasks
;;
api-worker-jobs)
exec $COMMON_CMD database-tasks,job-tasks
;;
api-worker-research)
exec $COMMON_CMD research-mode-tasks
;;
api-worker-sender)
exec $COMMON_CMD send-sms-tasks,send-email-tasks
;;
api-worker-sender-letters)
exec $COMMON_CMD send-letter-tasks
;;
api-worker-periodic)
exec $COMMON_CMD periodic-tasks
;;
api-worker-reporting)
exec $COMMON_CMD reporting-tasks
;;
api-worker-internal)
# Only consume the notify-internal-tasks queue on this app so that Notify messages are processed as a priority
exec $COMMON_CMD notify-internal-tasks
;;
api-worker-broadcasts)
exec $COMMON_CMD broadcast-tasks
;;
api-worker-receipts)
exec $COMMON_CMD ses-callbacks,sms-callbacks,letter-callbacks
;;
api-worker-service-callbacks)
exec $COMMON_CMD service-callbacks,service-callbacks-retry
;;
celery-beat)
exec celery -A run_celery.notify_celery beat --loglevel=INFO
;;
*)
echo -e "'\033[31m'FATAL: missing argument'\033[0m'" && exit 1
exit 1
;;
esac