diff --git a/Dockerfile b/Dockerfile index 910eac2..355d22a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,8 @@ FROM alpine:latest -ENV VERSION 0.3.5 ENV PUID=1000 PGID=1000 -RUN apk --update add --no-cache openjdk11-jre +RUN apk --update add --no-cache openjdk11-jre grep curl RUN mkdir /app RUN mkdir /config diff --git a/README.md b/README.md index 607824e..db2bc0c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ docker container for [JMusicBot](https://github.com/jagrosh/MusicBot) ## Usage -[JMusicBot](https://github.com/jagrosh/MusicBot) ### Docker Usage: `docker run -it -v yourpath/toconfig:/config yojoshb/jmusicbot:latest` diff --git a/run_bot.sh b/run_bot.sh index 96cea8c..f15cb24 100644 --- a/run_bot.sh +++ b/run_bot.sh @@ -2,8 +2,10 @@ echo "Starting JMusicBot" -if [ ! -f JMusicBot-${VERSION}.jar ]; then - wget https://github.com/jagrosh/MusicBot/releases/download/${VERSION}/JMusicBot-${VERSION}.jar +VER=$(curl --silent "https://api.github.com/repos/jagrosh/MusicBot/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")') + +if [ ! -f JMusicBot-$VER.jar ]; then + wget https://github.com/jagrosh/MusicBot/releases/download/$VER/JMusicBot-$VER.jar fi -java -Dnogui=true -Dconfig=/config/config.txt -jar JMusicBot-${VERSION}.jar +java -Dnogui=true -Dconfig=/config/config.txt -jar JMusicBot-$VER.jar