forked from RedHatInsights/vulnerability-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·35 lines (30 loc) · 1.47 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
#!/bin/sh
public_port () {
python3 -c "import app_common_python as a;print(a.LoadedConfig.publicPort or 8000)"
}
metrics_port () {
python3 -c "import app_common_python as a;print(a.LoadedConfig.metricsPort or 9000)"
}
cd $(dirname $0)
if [[ ! -z $1 ]]; then
if [[ "$1" == "listener" ]]; then
exec python3 -m listener.upload_listener
elif [[ "$1" == "evaluator" ]]; then
exec python3 -m evaluator.evaluator
elif [[ "$1" == "vmaas-sync" ]]; then
exec python3 -m vmaas_sync.vmaas_sync
elif [[ "$1" == "manager" ]]; then
exec gunicorn -c manager/gunicorn_conf.py -w ${GUNICORN_WORKERS:-4} --bind=0.0.0.0:$(public_port) --bind=0.0.0.0:$(metrics_port) --timeout=60 manager.main
elif [[ "$1" == "manager-dev" ]]; then
exec gunicorn --reload -c manager/gunicorn_conf.py -w ${GUNICORN_WORKERS:-4} --bind=0.0.0.0:$(public_port) --bind=0.0.0.0:$(metrics_port) --timeout=60 manager.main
elif [[ "$1" == "manager-admin" ]]; then
exec gunicorn -c manager/gunicorn_conf.py -w ${GUNICORN_WORKERS:-4} --bind=0.0.0.0:$(public_port) --bind=0.0.0.0:$(metrics_port) --timeout=60 manager.admin
elif [[ "$1" == "advisor-listener" ]]; then
exec python3 -m advisor_listener.advisor_listener
elif [[ "$1" == "taskomatic" ]]; then
exec python3 -m taskomatic.taskomatic
elif [[ "$1" == "notificator" ]]; then
exec python3 -m notificator.notificator
fi
fi
echo "Please specify service name as the first argument."