Skip to content

Commit

Permalink
Automatically get the latest pack version (closes #7 and closes #3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xalaxis committed May 15, 2020
1 parent b066c25 commit 4afbc93
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Based on JDK 11, as I think that is the most recent version which works with FTB Omnia and I'm assuming that more recent versions of Java have better optimizations
FROM openjdk:11
LABEL maintainer="matthew@wolfie.ovh"
# Make sure we have jq for JSON parsing
RUN apt-get update
RUN apt-get install jq -y

WORKDIR /usr/src/ftbomnia
COPY install.sh .
RUN chmod +x install.sh
# If the user does not provide a version, target the lastest.
ENV VERSION=LATEST
ENTRYPOINT [ "bash", "install.sh" ]
18 changes: 8 additions & 10 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@
set -e # Error out immediately on failed line
set +x # Don't print commands as they are run

VERSION="48"
# VERSION="48"
# VERSION now set in Dockerfile or overridden from command line

# 48 = 1.2.0
# 46 = 1.1.0
# If we're using the latest version (it's not manually specified)
if [ "$VERSION" == "LATEST" ]
# Lookup the latest version available from the API and save it to the version variable
then VERSION=$(curl https://api.modpacks.ch/public/modpack/6/ | jq '.versions[-1].id'); fi;




#mkdir -p /usr/src/ftbomnia # Make
#cp serverinstall_6_48 /usr/src/ftbomnia
#cd /usr/src/ftbomnia
echo "Downloading installer..."
wget https://api.modpacks.ch/public/modpack/6/48/server/linux -O installer
wget https://api.modpacks.ch/public/modpack/6/$VERSION/server/linux --content-disposition
echo "Making it executable..."
chmod +x ./installer
echo "Specifying modpack version"
mv ./installer ./serverinstall_6_$VERSION # The installer can install any version, and checks the filename to choose which to use
chmod +x ./serverinstall_6_$VERSION
echo "Executing installer..."
yes y | ./serverinstall_6_$VERSION # Agree to Installation
echo "Creating Minecraft EULA file"
Expand Down

0 comments on commit 4afbc93

Please sign in to comment.