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
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ RUN apt-get update \
rsync \
nano \
unzip \
zstd \
knockd \
ttf-dejavu \
&& apt-get clean
Expand Down
22 changes: 13 additions & 9 deletions scripts/start-utils
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,16 @@ function extract() {
destDir=${2?}

type=$(file -b --mime-type "${src}")
if [[ $type == application/zip ]]; then
unzip -q -d "${destDir}" "${src}"
elif [[ $type == application/x-tar ]]; then
tar -C "${destDir}" -xf "${src}"
else
log "ERROR: unsupported archive type: $type"
return 1
fi
}
case "${type}" in
application/zip)
unzip -q -d "${destDir}" "${src}"
;;
application/x-tar|application/gzip|application/x-bzip2|application/zstd)
tar -C "${destDir}" -xf "${src}"
;;
*)
log "ERROR: unsupported archive type: $type"
return 1
;;
esac
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
WORLD: /worlds/world-for-testing.tgz
WORLD: /worlds/world-for-testing.tar
volumes:
- ./worlds:/worlds:ro
- ./data:/data
14 changes: 14 additions & 0 deletions tests/setuponlytests/world_from_tarbz2/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3"

services:
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
WORLD: /worlds/world-for-testing.tar.bz2
volumes:
- ./worlds:/worlds:ro
- ./data:/data
1 change: 1 addition & 0 deletions tests/setuponlytests/world_from_tarbz2/verify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mc-image-helper assert fileExists world/level.dat
Binary file not shown.
14 changes: 14 additions & 0 deletions tests/setuponlytests/world_from_targz/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3"

services:
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
WORLD: /worlds/world-for-testing.tar.gz
volumes:
- ./worlds:/worlds:ro
- ./data:/data
1 change: 1 addition & 0 deletions tests/setuponlytests/world_from_targz/verify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mc-image-helper assert fileExists world/level.dat
Binary file not shown.
14 changes: 14 additions & 0 deletions tests/setuponlytests/world_from_tarzst/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3"

services:
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
WORLD: /worlds/world-for-testing.tar.zst
volumes:
- ./worlds:/worlds:ro
- ./data:/data
1 change: 1 addition & 0 deletions tests/setuponlytests/world_from_tarzst/verify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mc-image-helper assert fileExists world/level.dat
Binary file not shown.