skyline-apiserver/container/start_service.sh
Florian Haftmann 9c58aef47c refactor: Prefer FHS-conformant location
Formally using a FHS-conformant location clarifies that the files
are needed during runtime also.

See also https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html

Change-Id: I569b4248ff0ab6f075e526cf62a41cbf84fa2d08
2024-01-24 13:03:13 +01:00

29 lines
730 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 /opt/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[@]}"