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

Added debug mode. #6

parent 6cf4d1c2
No related branches found
No related tags found
No related merge requests found
......@@ -10,11 +10,15 @@ RUN apt update && apt -y install \
# Setup Engine
RUN mkdir -p /srv/src
RUN mkdir -p /srv/tests
RUN mkdir -p /srv/config
COPY src /srv/src
COPY tests /srv/tests
COPY run.sh /srv
VOLUME ["/srv/socket", "/srv/logs", "/var/audio/source", "/var/audio/playlist", "/var/audio/station"]
WORKDIR /srv
# Start the Engine
ENTRYPOINT ["./run.sh", "core"]
EXPOSE 1234/tcp
ENTRYPOINT ["./run.sh"]
CMD ["core"]
......@@ -9,14 +9,16 @@ docker="false"
#
# - core
# - debug
# - log
# - docker:core
# - docker:debug
# - docker:build
# - docker:push
#
#
if [[ $* =~ ^(core|debug)$ ]]; then
mode=$1
if [[ $* =~ ^(core|debug|log)$ ]]; then
mode=$1
fi
if [[ "$1" == *"docker:"* ]]; then
......@@ -46,6 +48,11 @@ if [[ $docker == "false" ]]; then
(cd src && liquidsoap --verbose --debug ./engine.liq)
fi
### Tails the log file only (Used for Docker debugging) ###
if [[ $mode == "log" ]]; then
tail -f logs/engine-core.log
fi
fi
......@@ -63,19 +70,40 @@ if [[ $docker == "true" ]]; then
exec sudo docker run \
--network="host" \
--name aura-engine-core \
--rm -d \
--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" \
-v "$AUDIO_DIR/station":"/var/audio/station" \
-v "$AUDIO_DIR/playlist":"/var/audio/playlist":ro \
-v "$AUDIO_DIR/station":"/var/audio/station":ro \
-v "$BASE_DIR/logs":"/srv/logs" \
-v "/tmp":"/tmp" \
--device /dev/snd \
--group-add audio \
autoradio/engine-core
fi
### 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/logs":"/srv/logs" \
-v "/tmp":"/tmp" \
--device /dev/snd \
--group-add audio \
autoradio/engine-core log
fi
### Create Docker Image from local project ###
if [[ $mode == "build" ]]; then
......
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