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

Default run targets "core" and "debug". engine#72

parent 07669b18
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
mode="engine"
mode="core"
docker="false"
#
......@@ -7,19 +7,15 @@ docker="false"
#
# Call with one of these parameters:
#
# - init
# - engine
# - core
# - lqs
# - test
# - recreate-database
# - debug
# - docker:engine
# - docker:core
# - docker:build
# - docker:push
#
if [[ $* =~ ^(init|env|engine|core|lqs|test|recreate-database)$ ]]; then
if [[ $* =~ ^(core|debug)$ ]]; then
mode=$1
fi
......@@ -33,52 +29,21 @@ echo "[ Run mode=$mode ]"
echo "[ Docker=$docker ]"
# Check for the correct Python version (3.8+)
PYTHON_EXEC="python3"
echo "[ Using $(python3 -V) ]"
# +++ DEFAULT COMMANDS +++ #
if [[ $docker == "false" ]]; then
### Initializes the environment & installs dependencies ###
if [[ $mode == "init" ]]; then
mkdir -p logs
pip3 install -r requirements.txt
fi
### Runs Engine Core & Liquidsoap ###
if [[ $mode == "engine" ]]; then
eval $(opam env)
/usr/bin/env $PYTHON_EXEC run.py
fi
### Runs Engine Core only ###
### Runs Engine Core (Liquidsoap) ###
if [[ $mode == "core" ]]; then
/usr/bin/env $PYTHON_EXEC run.py --without-lqs
fi
### Runs Liquidsoap only ###
if [[ $mode == "lqs" ]]; then
lqs=$(/usr/bin/env $PYTHON_EXEC run.py --get-lqs-command)
eval "$lqs"
fi
### Runs Tests ###
if [[ $mode == "test" ]]; then
/usr/bin/env $PYTHON_EXEC -m unittest discover tests
(cd src && liquidsoap ./engine.liq)
fi
### CAUTION: This deletes everything in your database ###
### Runs Engine Core (Verbose & debug output) ###
if [[ $mode == "recreate-database" ]]; then
/usr/bin/env $PYTHON_EXEC run.py --recreate-database
if [[ $mode == "debug" ]]; then
(cd src && liquidsoap --verbose --debug ./engine.liq)
fi
fi
......
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