generated from oci/template
adjust shit
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 29s
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 29s
This commit is contained in:
parent
a4143845f9
commit
84d6876b74
3 changed files with 44 additions and 29 deletions
|
@ -5,7 +5,7 @@ RUN apt-get update && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
11
docker-compose.yml
Normal file
11
docker-compose.yml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
services:
|
||||||
|
geyser:
|
||||||
|
build: .
|
||||||
|
# image: git.merith.xyz/oci/geyser:nightly
|
||||||
|
ports:
|
||||||
|
- 19132:19132
|
||||||
|
volumes:
|
||||||
|
- ./data:/data
|
||||||
|
|
|
@ -1,33 +1,37 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
cd /data
|
cd /data
|
||||||
wget -O /data/geyser.jar.new https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/standalone
|
|
||||||
|
|
||||||
GEYSER_NEWHASH=$(sha256sum /data/geyser.jar.new | cut -d' ' -f1)
|
JAR_PATH="geyser.jar"
|
||||||
if [ ! -f /data/geyser.jar ]; then
|
TMP_JAR="geyser.jar.new"
|
||||||
echo "Installing Geyser..."
|
DOWNLOAD_URL="https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/standalone"
|
||||||
mv /data/geyser.jar.new /data/geyser.jar
|
|
||||||
fi
|
|
||||||
GEYSER_OLDHASH=$(sha256sum /data/geyser.jar | cut -d' ' -f1)
|
|
||||||
if [ "$NEWHASH" != "$OLDHASH" ]; then
|
|
||||||
echo "Updating Geyser..."
|
|
||||||
mv /data/geyser.jar.new /data/geyser.jar
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Updating GeyserConnect..."
|
echo "Downloading latest Geyser standalone JAR..."
|
||||||
if [ -z "$GH_TOKEN" ]; then
|
wget -q -O "$TMP_JAR" "$DOWNLOAD_URL"
|
||||||
echo "No GH_TOKEN set, cannot update GeyserConnect."
|
|
||||||
|
# Get new JAR hash
|
||||||
|
if [[ -f "$TMP_JAR" ]]; then
|
||||||
|
NEW_HASH=$(sha256sum "$TMP_JAR" | awk '{print $1}')
|
||||||
else
|
else
|
||||||
|
echo "Download failed or empty. Aborting."
|
||||||
GEYSERCONNECT_BUILD=$(curl -s https://api.github.com/repos/GeyserMC/GeyserConnect/actions/workflows/build.yml/runs | jq -r '.workflow_runs[0].id')
|
exit 1
|
||||||
# TODO: FIX THIS URL
|
|
||||||
GEYSERCONNECT_URL=$(curl -s https://api.github.com/repos/GeyserMC/GeyserConnect/actions/runs/5027683930/artifacts | jq -r '.artifacts[0].archive_download_url')
|
|
||||||
curl -L \
|
|
||||||
-H "Accept: application/vnd.github+json" \
|
|
||||||
-H "Authorization: Bearer $GH_TOKEN" \
|
|
||||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
||||||
$GEYSERCONNECT_URL --output geyserconnect.zip
|
|
||||||
unzip -o geyserconnect.zip GeyserConnect.jar
|
|
||||||
mv GeyserConnect.jar extensions/GeyserConnect.jar
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
java -jar geyser.jar
|
# Install or update if necessary
|
||||||
|
if [[ ! -f "$JAR_PATH" ]]; then
|
||||||
|
echo "No existing Geyser JAR found. Installing..."
|
||||||
|
mv "$TMP_JAR" "$JAR_PATH"
|
||||||
|
else
|
||||||
|
OLD_HASH=$(sha256sum "$JAR_PATH" | awk '{print $1}')
|
||||||
|
if [[ "$NEW_HASH" != "$OLD_HASH" ]]; then
|
||||||
|
echo "New version detected. Updating Geyser..."
|
||||||
|
mv "$TMP_JAR" "$JAR_PATH"
|
||||||
|
else
|
||||||
|
echo "Geyser is already up to date."
|
||||||
|
rm -f "$TMP_JAR"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Starting Geyser..."
|
||||||
|
exec java -jar "$JAR_PATH"
|
||||||
|
|
Loading…
Reference in a new issue