diff --git a/Dockerfile b/Dockerfile index 899a723e..3068c5d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,7 +46,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ --var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \ --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz -ARG MC_HELPER_VERSION=1.28.2 +ARG MC_HELPER_VERSION=1.28.3 ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION} # used for cache busting local copy of mc-image-helper ARG MC_HELPER_REV=1 diff --git a/README.md b/README.md index 167de3b3..161a457c 100644 --- a/README.md +++ b/README.md @@ -607,11 +607,15 @@ The desired modpack project is specified with the `MODRINTH_PROJECT` environment ![](docs/modrinth-project-id.drawio.png) - The project page URL, such as . As described below, this can further be the page URL of a modpack's version page. -By default, the latest available version of the Modrinth modpack is selected based upon the value of `MODRINTH_DEFAULT_VERSION_TYPE`, which defaults to "release". Other valid values are "beta" and "alpha". +The automatic modpack version resolving can be narrowed in a few ways: -The selected version can also be narrowed by a few means: If wanting to use a particular mod loader, set `MODRINTH_LOADER` to either "forge" or "fabric" (Quilt support is coming soon). Since the overall `VERSION` gets dictated by the modpack, a specific modpack Minecraft version can be specified by setting `MODRINTH_MC_VERSION` to a valid version, such as "1.19.2". +The latest release or beta version, respectively, of the Modrinth modpack is selected when `VERSION` is "LATEST" or "SNAPSHOT". That can be overridden by setting `MODRINTH_DEFAULT_VERSION_TYPE` to "release", "beta", or "alpha". -A specific version of modpack file can be specified by passing the version's page URL to `MODRINTH_PROJECT`, such as or by setting `MODRINTH_VERSION_ID` to the version ID located in the Metadata section, as shown here +Furthermore, the resolved modpack version can be narrowed by setting `VERSION` to a specific Minecraft version, such as "1.19.2". + +The selected version can also be narrowed to a particular mod loader by setting `MODRINTH_LOADER` to either "forge" or "fabric" (Quilt support is coming soon). + +Instead of auto resolving, a specific version of modpack file can be specified by passing the version's page URL to `MODRINTH_PROJECT`, such as or by setting `MODRINTH_VERSION` to the version ID or number located in the Metadata section, as shown here ![](docs/modrinth-version-id.drawio.png) diff --git a/docs/modrinth-version-id.drawio.png b/docs/modrinth-version-id.drawio.png index 7ff96c9f..f0ccbf7f 100644 Binary files a/docs/modrinth-version-id.drawio.png and b/docs/modrinth-version-id.drawio.png differ diff --git a/examples/docker-compose-modrinth-modpack.yml b/examples/docker-compose-modrinth-modpack.yml index f6e213cb..f5befada 100644 --- a/examples/docker-compose-modrinth-modpack.yml +++ b/examples/docker-compose-modrinth-modpack.yml @@ -11,10 +11,14 @@ services: EULA: "TRUE" TYPE: MODRINTH MODRINTH_PROJECT: https://modrinth.com/modpack/cobblemon-fabric/version/1.3.2 - # or could be https://modrinth.com/modpack/cobblemon-fabric for auto-upgrading to latest + # or for auto-upgrading to latest + # MODRINTH_PROJECT: https://modrinth.com/modpack/cobblemon-fabric # or just cobblemon-fabric or 5FFgwNNP # and could replace version URL with - # MODRINTH_VERSION_ID: nvrqJg44 + # MODRINTH_VERSION: nvrqJg44 + # MODRINTH_VERSION: 1.3.2 + # MODRINTH_VERSION: "Cobblemon [Fabric] 1.3.2" + SETUP_ONLY: "true" volumes: # attach the relative directory 'data' to the container's /data path - ./data:/data diff --git a/scripts/start-deployModrinth b/scripts/start-deployModrinth index ae01fa26..1f1bf0a3 100644 --- a/scripts/start-deployModrinth +++ b/scripts/start-deployModrinth @@ -7,10 +7,8 @@ set -eu resultsFile=/data/.install-modrinth.env requireVar MODRINTH_PROJECT -: "${MODRINTH_MC_VERSION:=}" : "${MODRINTH_LOADER:=}" -: "${MODRINTH_VERSION_ID:=}" -: "${MODRINTH_DEFAULT_VERSION_TYPE:=release}" +: "${MODRINTH_VERSION:=${MODRINTH_VERSION_ID:-}}" isDebugging && set -x @@ -20,6 +18,19 @@ args=( --output-directory=/data ) +case "${VERSION^^}" in + LATEST) + : "${MODRINTH_DEFAULT_VERSION_TYPE:=release}" + ;; + SNAPSHOT) + : "${MODRINTH_DEFAULT_VERSION_TYPE:=beta}" + ;; + *) + : "${MODRINTH_DEFAULT_VERSION_TYPE:=release}" + args+=("--game-version=$VERSION") + ;; +esac + setArg() { arg="${1?}" var="${2?}" @@ -28,9 +39,8 @@ setArg() { args+=("${arg}=${!var}") fi } -setArg --game-version MODRINTH_MC_VERSION setArg --loader MODRINTH_LOADER -setArg --version-id MODRINTH_VERSION_ID +setArg --version MODRINTH_VERSION setArg --default-version-type MODRINTH_DEFAULT_VERSION_TYPE if ! mc-image-helper install-modrinth-modpack "${args[@]}"; then