From 2023d3d818d5f0fae750ba57d42a45d5e577193d Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 19 Mar 2023 19:45:57 -0500 Subject: [PATCH] autocf: allow for exclude/include file and list --- Dockerfile | 2 +- README.md | 4 ++-- scripts/start-deployAutoCF | 21 +++++++++------------ 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 89d9bb4bcea..d1141cd7f7a 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.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 - \ diff --git a/README.md b/README.md index 4a026a541a7..19bdf18553b 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/scripts/start-deployAutoCF b/scripts/start-deployAutoCF index 57c3f88f3df..639668a4ab2 100644 --- a/scripts/start-deployAutoCF +++ b/scripts/start-deployAutoCF @@ -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