diff --git a/.vscode/launch.json b/.vscode/launch.json index 127cf15f9a1bf8cf016774c3b2f0d8c253eb2875..56ec3c0f5214b201cc81aa45ecf57d63e12dc0b8 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -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" ] }, { diff --git a/run.sh b/run.sh index fb7682f496d447e8d73a72246d796ff227a6b506..86ceeb69390dda6f448164ef34f1fdebc7bb10de 100755 --- a/run.sh +++ b/run.sh @@ -1,35 +1,47 @@ -#/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