skyline-apiserver/container/start_service.sh
Gao Hanxiang a0701711be feat: Add bootstrap support for skyline image
When docker run, specify the KOLLA_BOOSTRAP environment variable, the
skyline image will initialize the database, and if it is not specified,
the skyline service will be run in the normal way.
This provides the basis for subsequent docking with kolla-ansible.

Change-Id: I5eaad038b3ed3c3189f2b41e41c14d28a346ee88
2021-07-26 11:01:31 -04:00

21 lines
434 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/libs/skyline-apiserver/
make db_sync
exit 0
fi
nginx-generator -o /etc/nginx/nginx.conf
nginx
echo "Running command: ${CMD[*]}"
exec "${CMD[@]}"