From 89c6db53fb49c4dab2a9ae70a119e6d966ec57bf Mon Sep 17 00:00:00 2001 From: spa77k <254093522+spa77k@users.noreply.github.com> Date: Thu, 26 Nov 2026 12:58:01 +0900 Subject: [PATCH] Document extracting archives with APPLY_EXTRA_FILES (#4404) --- docs/mods-and-plugins/index.md | 26 +++++++++++++ .../archives/configs.tar.gz | Bin 0 -> 152 bytes .../archives/plain.txt | 1 + .../archives/worlds.zip | Bin 0 -> 386 bytes .../docker-compose.yml | 35 ++++++++++++++++++ .../apply-extra-files-archive/fake.jar | 0 .../apply-extra-files-archive/require.sh | 2 + .../seed/world1/level.dat | 1 + .../apply-extra-files-archive/verify.sh | 8 ++++ 9 files changed, 73 insertions(+) create mode 100644 tests/setuponlytests/apply-extra-files-archive/archives/configs.tar.gz create mode 100644 tests/setuponlytests/apply-extra-files-archive/archives/plain.txt create mode 100644 tests/setuponlytests/apply-extra-files-archive/archives/worlds.zip create mode 100644 tests/setuponlytests/apply-extra-files-archive/docker-compose.yml create mode 100644 tests/setuponlytests/apply-extra-files-archive/fake.jar create mode 100644 tests/setuponlytests/apply-extra-files-archive/require.sh create mode 100644 tests/setuponlytests/apply-extra-files-archive/seed/world1/level.dat create mode 100644 tests/setuponlytests/apply-extra-files-archive/verify.sh diff --git a/docs/mods-and-plugins/index.md b/docs/mods-and-plugins/index.md index ae10e046..ed3dcc1e 100644 --- a/docs/mods-and-plugins/index.md +++ b/docs/mods-and-plugins/index.md @@ -124,6 +124,32 @@ A source path can refer to a directory, in which case the files within that dire The `APPLY_EXTRA_FILES` feature is processed prior to [patch processing](../configuration/interpolating.md#patching-existing-files), so this can be used as for baseline files to be patched further at runtime. +### Extracting archives + +A source can also be a ZIP or TAR archive (including `.tar.gz`, `.tar.bz2` and `.tar.zst`) that gets extracted into the destination directory, keeping the paths within the archive. Use a `<<` separator instead of `<` for those entries. Without a destination, such as `<CextI)jS|6^nb@f}2d)X&kZW)h8lhuO9f7dRaUHH&x1=qj(YKpUM zD*hJSd9zLX`lR)nZknuqZu$0L(z#WyidTJ?NiItA4YrLrmu%Tt^XRJntM`AWKedqg z)?0Un>s?UQ#d`Di_7$PUkEEZ@{Q3D`_Zn55eRG*0wnNAR*6XgV3tPyb!N33j&09q- literal 0 HcmV?d00001 diff --git a/tests/setuponlytests/apply-extra-files-archive/archives/plain.txt b/tests/setuponlytests/apply-extra-files-archive/archives/plain.txt new file mode 100644 index 00000000..b9bca019 --- /dev/null +++ b/tests/setuponlytests/apply-extra-files-archive/archives/plain.txt @@ -0,0 +1 @@ +plain diff --git a/tests/setuponlytests/apply-extra-files-archive/archives/worlds.zip b/tests/setuponlytests/apply-extra-files-archive/archives/worlds.zip new file mode 100644 index 0000000000000000000000000000000000000000..11cac65cc2f67ab16b530aec6f07944cdd3fc11e GIT binary patch literal 386 zcmWIWW@Zs#fB?mq3_ZqRULXgA1%S9bzbGfgP(LTNEHy_jC9x!}C_h&>u_!qsvn-V> z07Yx|hJD@aKrJ9Fj?h|^nx2`Tr(dLJ0ED^8i4Z=T-n_a5PBx$(5C&PBUy_kpq+gVp zn39{SS5i>|<^%OGGKnzYb}UdM7&I_~D0HWz>qd7kL@xtF1EV!UH@fT54MBG}!jN(x X6WtpD-mD-WGB5+-K_I;v#9;sc7ehyj literal 0 HcmV?d00001 diff --git a/tests/setuponlytests/apply-extra-files-archive/docker-compose.yml b/tests/setuponlytests/apply-extra-files-archive/docker-compose.yml new file mode 100644 index 00000000..801fdd67 --- /dev/null +++ b/tests/setuponlytests/apply-extra-files-archive/docker-compose.yml @@ -0,0 +1,35 @@ +services: + # places an existing world file into /data before mc starts, so the extraction must keep it + seed: + restart: "no" + image: ${IMAGE_TO_TEST:-itzg/minecraft-server} + entrypoint: ["bash", "-c", "mkdir -p /data/world1 && cp /seed/world1/level.dat /data/world1/ && chown -R 1000:1000 /data"] + volumes: + - ./seed:/seed + - ./data:/data + + mc: + restart: "no" + image: ${IMAGE_TO_TEST:-itzg/minecraft-server} + depends_on: + seed: + condition: service_completed_successfully + environment: + EULA: "true" + SETUP_ONLY: "true" + APPLY_EXTRA_FILES: | + # extracts only the world1 directory of the archive + world1<