2023-04-07 15:19:09 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-04-07 16:04:06 +02:00
|
|
|
URL_BUILD='https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest'
|
2023-04-07 15:19:09 +02:00
|
|
|
|
2023-04-07 16:04:06 +02:00
|
|
|
echo "Getting Geyser last build infos..."
|
2023-04-07 15:19:09 +02:00
|
|
|
|
|
|
|
# get paper build version
|
2023-04-07 16:08:02 +02:00
|
|
|
if ! curl -L -s $URL_BUILD -o build_infos.json; then
|
2023-04-09 18:11:22 +02:00
|
|
|
echo -e "Error: Can't join API"
|
2023-04-07 15:19:09 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-04-07 16:04:06 +02:00
|
|
|
if ! jq -r '.version' -e < build_infos.json > /dev/null; then
|
|
|
|
echo -e "API returned an error"
|
2023-04-07 15:19:09 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-04-07 16:04:06 +02:00
|
|
|
GEYSER_VERSION=$(jq -r '.version' < build_infos.json)
|
|
|
|
GEYSER_BUILD=$(jq -r '.build' < build_infos.json)
|
2023-04-07 15:19:09 +02:00
|
|
|
|
2023-04-07 16:04:06 +02:00
|
|
|
echo "Geyser verion $GEYSER_VERSION build #$GEYSER_BUILD"
|
2023-04-07 15:19:09 +02:00
|
|
|
|
2023-04-07 16:04:06 +02:00
|
|
|
DOWNLOAD_URL=$URL_BUILD'/downloads/standalone'
|
2023-04-07 15:19:09 +02:00
|
|
|
|
2023-04-07 16:04:06 +02:00
|
|
|
RUNNABLE_JAR='Geyser-'$GEYSER_VERSION'-'$GEYSER_BUILD'.jar'
|
2023-04-07 15:19:09 +02:00
|
|
|
|
2023-04-07 16:04:06 +02:00
|
|
|
echo "Downloadling Geyser Standalone..."
|
|
|
|
echo "From "$DOWNLOAD_URL
|
|
|
|
echo "To "$RUNNABLE_JAR
|
2023-04-07 16:08:02 +02:00
|
|
|
curl -L -o $RUNNABLE_JAR $DOWNLOAD_URL
|
2023-04-07 15:19:09 +02:00
|
|
|
|
|
|
|
|
2023-04-07 16:04:06 +02:00
|
|
|
DOCKER_TAG="cr.pandacube.fr/geyser:"$GEYSER_VERSION"-"$GEYSER_BUILD
|
2023-04-07 23:49:27 +02:00
|
|
|
DOCKER_TAG_LATEST="cr.pandacube.fr/geyser:latest"
|
2023-04-07 16:04:06 +02:00
|
|
|
echo "Building docker image of Geyser Standalone "$DOCKER_TAG
|
|
|
|
docker build --build-arg RUNNABLE_JAR=$RUNNABLE_JAR -t $DOCKER_TAG .
|
2023-04-07 23:49:27 +02:00
|
|
|
docker tag $DOCKER_TAG $DOCKER_TAG_LATEST
|
2023-04-07 15:19:09 +02:00
|
|
|
|
2023-04-09 18:11:22 +02:00
|
|
|
echo "Pushing image to Pandacube's container registry"
|
2023-04-07 15:19:09 +02:00
|
|
|
docker push $DOCKER_TAG
|
2023-04-07 23:49:27 +02:00
|
|
|
docker push $DOCKER_TAG_LATEST
|