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 @@ ...@@ -5,14 +5,34 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "Aura Engine - Run", "name": "Start Aura Engine",
"type": "python", "type": "python",
"request": "launch", "request": "launch",
"program": "${workspaceFolder}/engine-core.py", "program": "${workspaceFolder}/engine-core.py",
"console": "integratedTerminal" "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", "type": "python",
"request": "launch", "request": "launch",
"stopOnEntry": false, "stopOnEntry": false,
...@@ -23,9 +43,6 @@ ...@@ -23,9 +43,6 @@
}, },
"args": [ "args": [
"run" "run"
],
"debugOptions": [
"RedirectOutput"
] ]
}, },
{ {
......
#/usr/bin/bash #!/bin/bash
mode="engine" mode="engine"
debug="--debug"
#debug="--debug --verbose"
if [ -n "$1" ]; then if [[ $* =~ ^(engine|core|lqs|api-dev|api)$ ]]; then
if [[ $1 =~ ^(engine|lqs|api|api-prod)$ ]]; then mode=$1
mode=$1
fi
fi fi
echo "[ Run mode=$mode ]" 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 fi
if [ $mode == "lqs" ]; then ### Runs Liquidsoap only ###
(cd modules/liquidsoap/ && liquidsoap $debug ./engine.liq)
if [[ $mode == "lqs" ]]; then
lqs=$(/usr/bin/env python3.7 engine-core.py --get-lqs-command)
eval "$lqs"
fi fi
if [ $mode == "api" ]; then ### Runs the API Server (Development) ###
if [[ $mode == "api-dev" ]]; then
echo "Building Web Applications" echo "Building Web Applications"
sh ./script/build-web.sh sh ./script/build-web.sh
echo "Starting API Server" echo "Starting API Server"
/usr/bin/python3.7 api.py /usr/bin/env python3.7 engine-api.py
fi fi
if [ $mode == "api-prod" ]; then ### Runs the API Server (Production) ###
if [[ $mode == "api" ]]; then
echo "Building Web Applications" echo "Building Web Applications"
sh ./script/build-web.sh sh ./script/build-web.sh
echo "Starting API Server" echo "Starting API Server"
gunicorn -c configuration/gunicorn.conf.py api:app gunicorn -c configuration/gunicorn.conf.py engine-api:app
fi 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