Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scripts/start-configuration
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions scripts/start-deployPufferfish
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions scripts/start-utils
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/setuponlytests/pufferfish/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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