Added git support

This commit is contained in:
RallyBlock
2026-03-20 22:19:28 -07:00
parent 909a1a5764
commit d59d652fdd
3 changed files with 36 additions and 0 deletions
+4
View File
@@ -32,6 +32,7 @@ RUN chmod +x /tini \
wine-${WINE_FLAVOUR}-amd64=${WINE_VERSION} \
wine-${WINE_FLAVOUR}-i386=${WINE_VERSION} \
unzip \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
@@ -58,6 +59,9 @@ ENV BL_DEDI_LAN=0 \
BL_INST_NUM_PROC=10 \
BL_INST_FORCE=0 \
BL_INST_OVERWRITE=0 \
BL_UNZIP_ADDONS=0 \
BL_ADDON_REPO="" \
BL_ADDON_REPO_BRANCH="" \
BL_PATCH_ENABLE=1 \
BL_PATCH_EXE_URL=https://gitlab.com/-/project/19166101/uploads/7e9bc075056c3301fd1247975ecaa218/Blockland.exe \
BL_PATCH_LOADER_URL=https://gitlab.com/-/project/19166101/uploads/2970aa2d8c23259f8becb0f49630efcc/RedBlocklandLoader.dll \
+2
View File
@@ -26,6 +26,8 @@ The image is available on Docker Hub at [rallyblockk/blockland-pelican](https://
| BL_INST_FORCE | bool (0 or 1) | 0 | Forcefully install the game each time you launch
| BL_INST_OVERWRITE | bool (0 or 1) | 0 | Overwrite existing files during installation
| BL_UNZIP_ADDONS | bool (0 or 1) | 0 | When enabled, automatically extracts any .zip files in the Add-Ons directory before the server starts. Each zip is unzipped and the archive is removed. Handles single-folder, single-file, and multi-file zip structures so add-ons end up in properly named folders.
| BL_ADDON_REPO | string | "" | Git repository URL to clone into the Add-Ons folder on server start. Only runs on container boot (server reboot). If already cloned, fetches and pulls only when the remote has new commits.
| BL_ADDON_REPO_BRANCH | string | "" | Optional. Branch to clone and track when using BL_ADDON_REPO. Leave empty to use the repository's default branch.
| BL_PATCH_ENABLE | bool (0 or 1) | 1 | Patches the game with RedBlocklandLoader and the WineFix DLL to make the console work with Wine 8.0.2 (See Wine section below)
| BL_PATCH_EXE_URL | string | See Dockerfile | URL to retrieve the patched Blockland.exe from for RedBlocklandLoader
| BL_PATCH_LOADER_URL | string | See Dockerfile | URL to retrieve RedBlocklandLoader.dll from
+30
View File
@@ -71,6 +71,36 @@ if [ "${BL_UNZIP_ADDONS:-0}" -eq 1 ]; then
done
fi
# Sync Add-On from git repository if BL_ADDON_REPO is set (only on reboot; only pulls when remote has updates)
if [ -n "$BL_ADDON_REPO" ]; then
echo "Syncing Add-On from git repository..."
mkdir -p /home/container/Add-Ons
cd /home/container/Add-Ons
repo_name=$(basename "$BL_ADDON_REPO" .git)
if [ -d "$repo_name/.git" ]; then
cd "$repo_name"
git fetch origin
upstream=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null)
behind=$(git rev-list HEAD.."${upstream:-origin/HEAD}" --count 2>/dev/null || echo 0)
if [ "${behind:-0}" -gt 0 ]; then
echo "Add-On has updates, pulling..."
git pull --ff-only
else
echo "Add-On is up to date."
fi
cd /home/container/Add-Ons
else
clone_opts=()
[ -n "$BL_ADDON_REPO_BRANCH" ] && clone_opts=(-b "$BL_ADDON_REPO_BRANCH")
git clone "${clone_opts[@]}" "$BL_ADDON_REPO"
fi
cd /home/container || exit 1
fi
# Ensure we're in the correct directory (server root where Blockland.exe lives)
cd /home/container || exit 1