40 lines
1.0 KiB
Bash
40 lines
1.0 KiB
Bash
#!/bin/bash
|
||
|
||
URL_BUILD='https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest'
|
||
|
||
echo "Getting Geyser last build infos..."
|
||
|
||
# get paper build version
|
||
if ! curl -s $URL_BUILD -o build_infos.json; then
|
||
echo -e "Error: Can’t join API"
|
||
exit 1
|
||
fi
|
||
|
||
if ! jq -r '.version' -e < build_infos.json > /dev/null; then
|
||
echo -e "API returned an error"
|
||
exit 1
|
||
fi
|
||
|
||
GEYSER_VERSION=$(jq -r '.version' < build_infos.json)
|
||
GEYSER_BUILD=$(jq -r '.build' < build_infos.json)
|
||
|
||
echo "Geyser verion $GEYSER_VERSION build #$GEYSER_BUILD"
|
||
|
||
DOWNLOAD_URL=$URL_BUILD'/downloads/standalone'
|
||
|
||
RUNNABLE_JAR='Geyser-'$GEYSER_VERSION'-'$GEYSER_BUILD'.jar'
|
||
|
||
echo "Downloadling Geyser Standalone..."
|
||
echo "From "$DOWNLOAD_URL
|
||
echo "To "$RUNNABLE_JAR
|
||
curl -o $RUNNABLE_JAR $DOWNLOAD_URL
|
||
|
||
|
||
DOCKER_TAG="cr.pandacube.fr/geyser:"$GEYSER_VERSION"-"$GEYSER_BUILD
|
||
echo "Building docker image of Geyser Standalone "$DOCKER_TAG
|
||
docker build --build-arg RUNNABLE_JAR=$RUNNABLE_JAR -t $DOCKER_TAG .
|
||
|
||
|
||
echo "Pushing image to Pandacube’s container registry"
|
||
docker push $DOCKER_TAG
|