made repo configurable

This commit is contained in:
Leopold 2024-09-28 16:00:33 +02:00 committed by Ingwerpold
parent 06393c9d39
commit f32494d624
2 changed files with 3 additions and 2 deletions

View file

@ -9,6 +9,7 @@ RUN install_packages openjdk-11-jre-headless wget curl grep \
STOPSIGNAL SIGTERM
ENV BOT_VERSION latest
ENV BOT_REPO jagrosh/MusicBot
COPY run_bot.sh /app/run_bot.sh
RUN chmod +x /app/run_bot.sh

View file

@ -1,7 +1,7 @@
#!/bin/bash
# Set the default version to latest
VER_DEFAULT=$(curl --silent "https://api.github.com/repos/jagrosh/MusicBot/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
VER_DEFAULT=$(curl --silent "https://api.github.com/repos/$BOT_REPO/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
# If the ENV is not explicitly set, use the sourced ENV from the Dockerfile
if [ $BOT_VERSION == "latest" ]; then
@ -10,7 +10,7 @@ fi
echo -e "Downloading JMusicBot $BOT_VERSION"
if [ ! -f JMusicBot-$BOT_VERSION.jar ]; then
wget https://github.com/jagrosh/MusicBot/releases/download/$BOT_VERSION/JMusicBot-$BOT_VERSION.jar
wget https://github.com/$BOT_REPO/releases/download/$BOT_VERSION/JMusicBot-$BOT_VERSION.jar
fi
echo -e "Starting JMusicBot $BOT_VERSION"