diff --git a/Readme.md b/Readme.md index 1b1811b..feb2a5d 100644 --- a/Readme.md +++ b/Readme.md @@ -3,19 +3,18 @@ Jenkins pipeline to build a Docker image of Geyser Standalone. ```bash -build.sh # the old pipeline script, not used anymore -Dockerfile # used to build the image -Jenkinsfile # the new pipeline script +Dockerfile # used to build the Docker image +Jenkinsfile # the pipeline file Readme.md # you are reading this file -run.sh # entrypoint of the docker image +run.sh # entrypoint of the Docker image ``` ## Pipeline process -- Fetches the information about the latest build of Geyser (version, build number), from the [GeyserMC API](https://download.geysermc.org/v2/projects) -- Downloads the Geyser Standalone jar file. -- Builds the docker image with the downloaded jar and the entrypoint script. -- Pushes the image to the container registry with the tags `latest` and `$geyser_version-$geyser_build` (e.g. `2.2.0-408`) +1. Fetches the information about the latest build of Geyser (version, build number), from the [GeyserMC API](https://download.geysermc.org/v2/projects) +2. Downloads the Geyser Standalone jar file. +3. Builds the docker image with the downloaded jar and the entrypoint script. +4. Pushes the image to the container registry with the tags `latest` and `$geyser_version-$geyser_build` (e.g. `2.2.0-408`) ## Docker Compose Example diff --git a/build.sh b/build.sh deleted file mode 100644 index f79f773..0000000 --- a/build.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/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 -L -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 -L -o $RUNNABLE_JAR $DOWNLOAD_URL - - -DOCKER_TAG="cr.pandacube.fr/geyser:"$GEYSER_VERSION"-"$GEYSER_BUILD -DOCKER_TAG_LATEST="cr.pandacube.fr/geyser:latest" -echo "Building docker image of Geyser Standalone "$DOCKER_TAG -docker build --build-arg RUNNABLE_JAR=$RUNNABLE_JAR -t $DOCKER_TAG . -docker tag $DOCKER_TAG $DOCKER_TAG_LATEST - -echo "Pushing image to Pandacube's container registry" -docker push $DOCKER_TAG -docker push $DOCKER_TAG_LATEST