Skip to content
Snippets Groups Projects
Commit c21e2893 authored by David Trattnig's avatar David Trattnig
Browse files

Improved startup and shutdown.

parent f52dfa04
No related branches found
No related tags found
No related merge requests found
......@@ -5,14 +5,34 @@
"version": "0.2.0",
"configurations": [
{
"name": "Aura Engine - Run",
"name": "Start Aura Engine",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/engine-core.py",
"console": "integratedTerminal"
},
{
"name": "Aura Engine API - Run",
"name": "Start Engine Core Only",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/engine-core.py",
"args": [
"--without-lqs"
],
"console": "integratedTerminal"
},
{
"name": "Start Engine LQS Only",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/engine-core.py",
"args": [
"--lqs-only"
],
"console": "integratedTerminal"
},
{
"name": "Start Engine API",
"type": "python",
"request": "launch",
"stopOnEntry": false,
......@@ -23,9 +43,6 @@
},
"args": [
"run"
],
"debugOptions": [
"RedirectOutput"
]
},
{
......
#/usr/bin/bash
#!/bin/bash
mode="engine"
debug="--debug"
#debug="--debug --verbose"
if [ -n "$1" ]; then
if [[ $1 =~ ^(engine|lqs|api|api-prod)$ ]]; then
mode=$1
fi
if [[ $* =~ ^(engine|core|lqs|api-dev|api)$ ]]; then
mode=$1
fi
echo "[ Run mode=$mode ]"
if [ $mode == "engine" ]; then
/usr/bin/python3.7 aura.py
### Runs Engine Core & Liquidsoap ###
if [[ $mode == "engine" ]]; then
/usr/bin/env python3.7 engine-core.py
fi
### Runs Engine Core only ###
if [[ $mode == "core" ]]; then
/usr/bin/env python3.7 engine-core.py --without-lqs
fi
if [ $mode == "lqs" ]; then
(cd modules/liquidsoap/ && liquidsoap $debug ./engine.liq)
### Runs Liquidsoap only ###
if [[ $mode == "lqs" ]]; then
lqs=$(/usr/bin/env python3.7 engine-core.py --get-lqs-command)
eval "$lqs"
fi
if [ $mode == "api" ]; then
### Runs the API Server (Development) ###
if [[ $mode == "api-dev" ]]; then
echo "Building Web Applications"
sh ./script/build-web.sh
echo "Starting API Server"
/usr/bin/python3.7 api.py
/usr/bin/env python3.7 engine-api.py
fi
if [ $mode == "api-prod" ]; then
### Runs the API Server (Production) ###
if [[ $mode == "api" ]]; then
echo "Building Web Applications"
sh ./script/build-web.sh
echo "Starting API Server"
gunicorn -c configuration/gunicorn.conf.py api:app
gunicorn -c configuration/gunicorn.conf.py engine-api:app
fi
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment