Newer
Older
#
# Run Script for AURA Engine
#
# Call with one of these parameters:
#
### Runs Engine Core in Development (Liquidsoap) ###
(cd src && $LQS_CMD ./engine.liq)
fi
### Runs Engine Core in Production (Liquidsoap) ###
if [[ $mode == "prod" ]]; then
(cd src && $LQS_CMD ./engine.liq)
### Runs Engine Core (Verbose & debug output) ###
if [[ $mode == "debug" ]]; then
(cd src && $LQS_CMD --verbose --debug ./engine.liq)
### Tails the log file only (Used for Docker debugging) ###
if [[ $mode == "log" ]]; then
tail -f logs/engine-core.log
fi
# +++ DOCKER COMMANDS +++ #
if [[ $docker == "true" ]]; then
BASE_DIR=$(readlink -f .)
AUDIO_DIR=$(readlink -f ./audio)
echo "Absolute base dir: " $BASE_DIR
echo "Absolute audio dir: " $AUDIO_DIR
exec sudo docker run \
--network="host" \
-v "$BASE_DIR/config/engine-core.docker.ini":"/srv/config/engine-core.ini":ro \
-v "$BASE_DIR/socket":"/srv/socket" \
-v "$AUDIO_DIR/source":"/var/audio/source":ro \
-v "$AUDIO_DIR/playlist":"/var/audio/playlist":ro \
-v "$AUDIO_DIR/station":"/var/audio/station":ro \
--device /dev/snd \
--group-add audio \
autoradio/engine-core
### Debugging mode: only tails the log file and enter the container manually ###
if [[ $mode == "debug" ]]; then
exec sudo docker run \
--network="host" \
--name aura-engine-core \
--rm \
-u $UID:$GID \
-v "$BASE_DIR/config/engine-core.docker.ini":"/srv/config/engine-core.ini":ro \
-v "$BASE_DIR/socket":"/srv/socket" \
-v "$AUDIO_DIR/source":"/var/audio/source":ro \
-v "$AUDIO_DIR/playlist":"/var/audio/playlist":ro \
-v "$AUDIO_DIR/station":"/var/audio/station":ro \
-v "$BASE_DIR/contrib":"/srv/contrib" \
-v "$BASE_DIR/contrib":"/srv/contrib" \
-v "$BASE_DIR/tests":"/srv/tests" \
--privileged \
--memory=8g --memory-reservation=4g \
--cpus=4.0 --cpu-shares=3000 \
--device /dev/snd \
--group-add audio \
autoradio/engine-core log
fi
### Create Docker Image from local project ###
if [[ $mode == "build" ]]; then
docker build -t autoradio/engine-core .
### Pushes the latest Docker Image to Docker Hub ###
if [[ $mode == "push" ]]; then