forked from alphagov/notifications-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·94 lines (90 loc) · 2.48 KB
/
Copy pathentrypoint.sh
File metadata and controls
executable file
·94 lines (90 loc) · 2.48 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
export PROMETHEUS_MULTIPROC_DIR="/tmp"
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 "${2:-head}"
;;
migration-nl)
exec flask db upgrade --directory migrations_nl "${2:-head}"
;;
migration-downgrade)
exec flask db downgrade "${2:?migration-downgrade requires a target revision as \$2}"
;;
migration-nl-downgrade)
exec flask db downgrade --directory migrations_nl "${2:?migration-nl-downgrade requires a target revision as \$2}"
;;
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 job-tasks
;;
api-worker-jobs-save)
exec $COMMON_CMD database-tasks
;;
api-worker-jobs-save-documents)
exec $COMMON_CMD database-tasks-documents
;;
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-receipts)
exec $COMMON_CMD ses-callbacks,sms-callbacks,letter-callbacks,messagebox-callbacks
;;
api-worker-service-callbacks)
exec $COMMON_CMD service-callbacks
;;
api-worker-service-callbacks-retry)
exec $COMMON_CMD service-callbacks-retry
;;
api-worker-report-requests-notifications)
exec $COMMON_CMD report-requests-notifications-tasks
;;
# === NotifyNL
api-worker-messagebox)
exec $COMMON_CMD messagebox-tasks
;;
# ============
celery-beat)
exec celery --quiet -A run_celery.notify_celery beat
;;
*)
echo -e "'\033[31m'FATAL: missing argument'\033[0m'" && exit 1
exit 1
;;
esac