From b89844d5b27f2a5ddd6ed970f21245fb1553892a Mon Sep 17 00:00:00 2001 From: Anton Bardov <32146703+Two-Faces@users.noreply.github.com> Date: Fri, 23 Jun 2023 20:47:23 +0300 Subject: [PATCH] Added support for Magma version tags (#2247) --- README.md | 4 +++- scripts/start-deployMagma | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dc8128d7..5a67ce17 100644 --- a/README.md +++ b/README.md @@ -511,8 +511,10 @@ Extra variables: A [Magma](https://magmafoundation.org/) server, which is a combination of Forge and PaperMC, can be used with -e TYPE=MAGMA + -e MAGMA_VERSION=9f3a3c25 -> **NOTE** there are limited base versions supported, so you will also need to set `VERSION`, such as "1.12.2", "1.16.5", etc. +> **NOTE** there are limited base versions supported, so you will also need to set `VERSION`, such as "1.12.2", "1.16.5", etc. +> To switch the MAGMA version, you need to take the name of the desired tag from the magmafoundation git repository, [for example, to version 1.18](https://git.magmafoundation.org/magmafoundation/Magma-1-18-x/-/tags). ### Running a Mohist server diff --git a/scripts/start-deployMagma b/scripts/start-deployMagma index 9a6f92ea..4908414c 100755 --- a/scripts/start-deployMagma +++ b/scripts/start-deployMagma @@ -4,9 +4,11 @@ . "${SCRIPTS:-/}start-utils" isDebugging && set -x +: "${MAGMA_VERSION:=}" + resolveVersion -if ! downloadUrl=$(get --json-path '$.link' "https://api.magmafoundation.org/api/v2/${VERSION}/latest"); then +if ! downloadUrl=$(get --json-path '$.link' "https://api.magmafoundation.org/api/v2/${VERSION}/latest/${MAGMA_VERSION}"); then log "ERROR failed to locate latest Magma download for ${VERSION}. Is that version supported?" exit 1 fi