diff --git a/scripts/start-configuration b/scripts/start-configuration index 692a339d223..a3720a52bb2 100755 --- a/scripts/start-configuration +++ b/scripts/start-configuration @@ -116,7 +116,9 @@ case "X$VERSION" in ;; esac export VANILLA_VERSION -log "Resolved version given ${VERSION} into ${VANILLA_VERSION}" +MAJOR_VANILLA_VERSION=$(get_major_version "$VANILLA_VERSION") +export MAJOR_VANILLA_VERSION +log "Resolved version given ${VERSION} into ${VANILLA_VERSION} and major version ${MAJOR_VANILLA_VERSION}" cd /data || exit 1 diff --git a/scripts/start-deployPufferfish b/scripts/start-deployPufferfish index 34a4a5b8312..16a337b2f9c 100755 --- a/scripts/start-deployPufferfish +++ b/scripts/start-deployPufferfish @@ -8,14 +8,14 @@ isDebugging && set -x IFS=$'\n\t' -if [[ "${VANILLA_VERSION}" != "1.18" ]] && [[ "${VANILLA_VERSION}" != "1.17" ]]; then +if [[ "${MAJOR_VANILLA_VERSION}" != "1.18" ]] && [[ "${MAJOR_VANILLA_VERSION}" != "1.17" ]]; then log "ERROR: Pufferfish server type only supports versions 1.18 or 1.17, use PUFFERFISH_BUILD to select the the correct build 47 => 1.18.1, 50 => 1.18.2 etc" exit 1 fi : "${PUFFERFISH_BUILD:=lastSuccessfulBuild}" -PUFFERFISH_BUILD_JSON=$(curl -X GET -s "https://ci.pufferfish.host/job/Pufferfish-${VANILLA_VERSION}/${PUFFERFISH_BUILD}/api/json") +PUFFERFISH_BUILD_JSON=$(curl -X GET -s "https://ci.pufferfish.host/job/Pufferfish-${MAJOR_VANILLA_VERSION}/${PUFFERFISH_BUILD}/api/json") # Example: "url": "https://ci.pufferfish.host/job/Pufferfish-1.18/50/", PUFFERFISH_BUILD_URL=$(jq -n "$PUFFERFISH_BUILD_JSON" | jq -jc '.url // empty' ) # Example: "fileName": "pufferfish-paperclip-1.18.2-R0.1-SNAPSHOT-reobf.jar", diff --git a/scripts/start-utils b/scripts/start-utils index eea451a31a5..8e2ee94e7d1 100755 --- a/scripts/start-utils +++ b/scripts/start-utils @@ -8,6 +8,11 @@ function join_by() { printf "%s" "${@/#/$d}" } +function get_major_version() { + version=$1 + echo "$version" | cut -d. -f 1-2 +} + function isURL() { local value=$1 diff --git a/tests/setuponlytests/pufferfish/docker-compose.yml b/tests/setuponlytests/pufferfish/docker-compose.yml index bad46b0d3ad..89438dd3828 100644 --- a/tests/setuponlytests/pufferfish/docker-compose.yml +++ b/tests/setuponlytests/pufferfish/docker-compose.yml @@ -8,7 +8,7 @@ services: EULA: "TRUE" SETUP_ONLY: "TRUE" TYPE: PUFFERFISH - VERSION: 1.18 + VERSION: ${MINECRAFT_VERSION:-LATEST} PUFFERFISH_BUILD: 50 volumes: - ./data:/data