skyline-apiserver/container/start_service.sh
Boxiang Zhu 1393aea120 feat: Support both http and https for nginx.conf.j2 template
By default, if we do not supply the ssl_certfile and ssl_keyfile,
nginx will use http.

Change-Id: Iba86cd119e1aeec892c2b663c994778b63767e3e
2022-10-21 14:59:23 +08:00

29 lines
726 B
Bash
Executable File

#!/usr/bin/env bash
set -ex
# kolla_set_configs
echo "/usr/local/bin/gunicorn -c /etc/skyline/gunicorn.py skyline_apiserver.main:app" >/run_command
mapfile -t CMD < <(tail /run_command | xargs -n 1)
# kolla_extend_start
if [[ "${!KOLLA_BOOTSTRAP[*]}" ]]; then
cd /skyline-apiserver/
make db_sync
exit 0
fi
GENERATOR_ARGS="--output-file /etc/nginx/nginx.conf"
if [[ -n "${LISTEN_ADDRESS}" ]]; then
GENERATOR_ARGS+=" --listen-address ${LISTEN_ADDRESS}"
fi
if [[ -n "${SSL_CERTFILE}" ]] && [[ -n "${SSL_KEYFILE}" ]]; then
GENERATOR_ARGS+=" --ssl-certfile ${SSL_CERTFILE} --ssl-keyfile ${SSL_KEYFILE}"
fi
skyline-nginx-generator ${GENERATOR_ARGS}
nginx
echo "Running command: ${CMD[*]}"
exec "${CMD[@]}"