mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-11-10 06:14:14 +00:00
autocf: allow for exclude/include file and list (#2019)
This commit is contained in:
parent
0dd3e9e9b7
commit
f6493892e5
3 changed files with 12 additions and 15 deletions
|
@ -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.25.14
|
||||
ARG MC_HELPER_VERSION=1.25.15
|
||||
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
|
||||
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
|
||||
| tar -C /usr/share -zxf - \
|
||||
|
|
|
@ -663,9 +663,9 @@ The following examples all refer to version 1.0.7 of ATM8:
|
|||
|
||||
Quite often there are mods that need to be excluded, such as ones that did not properly declare as a client mod via the file's game versions. Similarly, there are some mods that are incorrectly tagged as client only. The following describes two options to exclude/include mods:
|
||||
|
||||
Global and per modpack exclusions can be declared in a JSON file and referenced with `CF_EXCLUDE_INCLUDE_FILE`. By default, [the file bundled with the image](files/cf-exclude-include.json) will be used. The schema of this file [is documented here](https://github.com/itzg/mc-image-helper#excludeinclude-file-schema).
|
||||
Global and per modpack exclusions can be declared in a JSON file and referenced with `CF_EXCLUDE_INCLUDE_FILE`. By default, [the file bundled with the image](files/cf-exclude-include.json) will be used, but can be disabled by setting this to an empty string. The schema of this file [is documented here](https://github.com/itzg/mc-image-helper#excludeinclude-file-schema).
|
||||
|
||||
Alternatively, they can be excluded by passing a comma or space delimited list of **project** slugs or IDs via `CF_EXCLUDE_MODS`. Similarly, there are some mods that are incorrectly tagged as client only. For those, pass the **project** slugs or IDs via `CF_FORCE_INCLUDE_MODS`. If either of these are set, then `CF_EXCLUDE_INCLUDE_FILE` will be **disabled**.
|
||||
Alternatively, they can be excluded by passing a comma or space delimited list of **project** slugs or IDs via `CF_EXCLUDE_MODS`. Similarly, there are some mods that are incorrectly tagged as client only. For those, pass the **project** slugs or IDs via `CF_FORCE_INCLUDE_MODS`. These lists will be combined with the content of the exclude/include file, if given.
|
||||
|
||||
A mod's project ID can be obtained from the right hand side of the project page:
|
||||
![cf-project-id](docs/cf-project-id.png)
|
||||
|
|
|
@ -10,7 +10,7 @@ set -eu
|
|||
: "${CF_FILENAME_MATCHER:=}"
|
||||
: "${CF_PARALLEL_DOWNLOADS:=4}"
|
||||
: "${CF_FORCE_SYNCHRONIZE:=false}"
|
||||
: "${CF_EXCLUDE_INCLUDE_FILE:=https://raw.githubusercontent.com/itzg/docker-minecraft-server/master/files/cf-exclude-include.json}"
|
||||
: "${CF_EXCLUDE_INCLUDE_FILE=https://raw.githubusercontent.com/itzg/docker-minecraft-server/master/files/cf-exclude-include.json}"
|
||||
: "${CF_EXCLUDE_MODS:=}"
|
||||
: "${CF_FORCE_INCLUDE_MODS:=}"
|
||||
: "${CF_SET_LEVEL_FROM:=}" # --set-level-from
|
||||
|
@ -45,17 +45,14 @@ args+=(
|
|||
--overrides-skip-existing="$CF_OVERRIDES_SKIP_EXISTING"
|
||||
)
|
||||
|
||||
if [[ $CF_EXCLUDE_MODS || $CF_FORCE_INCLUDE_MODS ]]; then
|
||||
if [[ $CF_EXCLUDE_MODS ]]; then
|
||||
args+=( --exclude-mods="$CF_EXCLUDE_MODS" )
|
||||
fi
|
||||
if [[ $CF_FORCE_INCLUDE_MODS ]]; then
|
||||
args+=( --force-include-mods="$CF_FORCE_INCLUDE_MODS" )
|
||||
fi
|
||||
else
|
||||
if [[ $CF_EXCLUDE_INCLUDE_FILE ]]; then
|
||||
args+=( --exclude-include-file="$CF_EXCLUDE_INCLUDE_FILE" )
|
||||
fi
|
||||
if [[ $CF_EXCLUDE_MODS ]]; then
|
||||
args+=( --exclude-mods="$CF_EXCLUDE_MODS" )
|
||||
fi
|
||||
if [[ $CF_FORCE_INCLUDE_MODS ]]; then
|
||||
args+=( --force-include-mods="$CF_FORCE_INCLUDE_MODS" )
|
||||
fi
|
||||
if [[ $CF_EXCLUDE_INCLUDE_FILE ]]; then
|
||||
args+=( --exclude-include-file="$CF_EXCLUDE_INCLUDE_FILE" )
|
||||
fi
|
||||
|
||||
if ! mc-image-helper install-curseforge "${args[@]}"; then
|
||||
|
|
Loading…
Reference in a new issue