2024-03-25 20:45:31 +01:00
|
|
|
#!/bin/bash -e
|
|
|
|
world=$(mktemp -d)
|
|
|
|
trap 'rm -rf "$world" || :' EXIT
|
|
|
|
|
|
|
|
[ -f game.conf ] || { echo "Must be run in game root folder." >&2; exit 1; }
|
|
|
|
|
2024-08-18 19:35:43 +02:00
|
|
|
chmod -R 777 "$world" # container uses unprivileged user inside
|
2024-03-25 20:45:31 +01:00
|
|
|
|
|
|
|
vol=(
|
|
|
|
-v "$PWD/utils/test/minetest.conf":/etc/minetest/minetest.conf
|
|
|
|
--tmpfs /var/lib/minetest/.minetest
|
|
|
|
-v "$PWD":/var/lib/minetest/.minetest/games/minetest_game
|
|
|
|
-v "$world":/var/lib/minetest/.minetest/world
|
|
|
|
)
|
|
|
|
[ -z "$DOCKER_IMAGE" ] && DOCKER_IMAGE="ghcr.io/minetest/minetest:master"
|
2024-08-18 19:35:43 +02:00
|
|
|
docker run --rm -i "${vol[@]}" "$DOCKER_IMAGE" --config /etc/minetest/minetest.conf --gameid minetest
|
2024-03-25 20:45:31 +01:00
|
|
|
|
2024-08-18 19:35:43 +02:00
|
|
|
test -f "$world/map.sqlite" || exit 1
|
2024-03-25 20:45:31 +01:00
|
|
|
exit 0
|