Added environment variable to set version of server

This commit is contained in:
2025-08-22 21:34:07 +02:00
parent 1d57f2cc10
commit 84276d2816
2 changed files with 11 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ RUN apt-get update && apt-get install -y wget
ENV MAX_LOGS="20"
ENV LOG_DIR="/var/log/glassminers"
ENV LOG_DATE_FORMAT="%Y-%m-%d-%H-%M-%S"
ENV VERSION="latest"
RUN mkdir -p ${LOG_DIR}

View File

@@ -1,7 +1,15 @@
#!/bin/bash
echo "[Info] Downloading latest server version..."
wget https://github.com/surrealtm/Glassminers/releases/latest/download/GMServer.out -O "server.out"
VERSION=${VERSION:- "latest"}
echo "[Info] Downloading server (${VERSION})..."
if [ "$VERSION" = "latest" ]; then
wget https://github.com/surrealtm/Glassminers/releases/latest/download/GMServer.out -O "server.out"
else
wget https://github.com/surrealtm/Glassminers/releases/download/${VERSION}/GMServer.out -O "server.out"
fi
if [ $? -ne 0 ]; then
echo "[Error] Download failed! Aborting."