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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://modrinth.com/modpack/cobblemon-fabric>. 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 <https://modrinth.com/modpack/cobblemon-fabric/version/1.3.2> 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 <https://modrinth.com/modpack/cobblemon-fabric/version/1.3.2> 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)

Expand Down
Binary file modified docs/modrinth-version-id.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions examples/docker-compose-modrinth-modpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 15 additions & 5 deletions scripts/start-deployModrinth
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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?}"
Expand All @@ -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
Expand Down