Improve/add initial project structure for ZomboidForge with build system, runtime, and patching logic.
Added version support for building images.
This commit is contained in:
1 parent
bf9228d2be
commit
015e9bb2c8
32 files changed
+1268
-58
No files matched your search
@@ -4,8 +4,14 @@
|
||||
# with steamcmd, using an anonymous login. Runs in the steamcmd image during
|
||||
# the Docker build.
|
||||
#
|
||||
# Usage: install-server.sh <install-dir> <branch>
|
||||
# <branch> Steam branch; "public" is the default branch.
|
||||
# Usage: install-server.sh <install-dir> <branch> <steamclient>
|
||||
# <branch> Steam branch: "public" (default branch), "unstable", or a
|
||||
# version branch such as "42.19".
|
||||
# <steamclient> "bundled" keeps the steamclient.so files shipped with the
|
||||
# server; "steamcmd" replaces them with steamcmd's own, newer
|
||||
# copies (a known workaround for failing Workshop downloads).
|
||||
#
|
||||
# Writes the installed Steam build ID to <install-dir>/steam-buildid.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
@@ -13,15 +19,17 @@ set -o pipefail
|
||||
|
||||
readonly APP_ID="380870"
|
||||
readonly MAX_ATTEMPTS=3
|
||||
readonly STEAMCMD_DIR="${HOME}/.local/share/Steam/steamcmd"
|
||||
|
||||
readonly INSTALL_DIR="$1"
|
||||
readonly BRANCH="$2"
|
||||
readonly STEAMCLIENT="$3"
|
||||
|
||||
log() {
|
||||
echo "[install-server] $*" >&2
|
||||
}
|
||||
|
||||
main() {
|
||||
install_app() {
|
||||
local branch_args=()
|
||||
if [[ "${BRANCH}" != "public" ]]; then
|
||||
branch_args=("-beta" "${BRANCH}")
|
||||
@@ -47,6 +55,43 @@ main() {
|
||||
log "Installation failed: ${INSTALL_DIR}/java/projectzomboid.jar not found"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Copies the build ID from Steam's app manifest, which is removed afterwards.
|
||||
record_build_id() {
|
||||
local manifest="${INSTALL_DIR}/steamapps/appmanifest_${APP_ID}.acf"
|
||||
local build_id
|
||||
|
||||
build_id="$(grep --max-count=1 '"buildid"' "${manifest}" | tr --delete --complement '0-9')"
|
||||
if [[ -z "${build_id}" ]]; then
|
||||
log "No buildid found in ${manifest}"
|
||||
exit 1
|
||||
fi
|
||||
echo "${build_id}" > "${INSTALL_DIR}/steam-buildid"
|
||||
log "Installed Steam build ${build_id}"
|
||||
}
|
||||
|
||||
# The install root holds the 32-bit steamclient.so, linux64/ the 64-bit one.
|
||||
replace_steamclient() {
|
||||
case "${STEAMCLIENT}" in
|
||||
bundled)
|
||||
;;
|
||||
steamcmd)
|
||||
log "Replacing the bundled steamclient.so files with steamcmd's"
|
||||
cp "${STEAMCMD_DIR}/linux32/steamclient.so" "${INSTALL_DIR}/steamclient.so"
|
||||
cp "${STEAMCMD_DIR}/linux64/steamclient.so" "${INSTALL_DIR}/linux64/steamclient.so"
|
||||
;;
|
||||
*)
|
||||
log "Unknown steamclient option '${STEAMCLIENT}' (expected: bundled, steamcmd)"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main() {
|
||||
install_app
|
||||
record_build_id
|
||||
replace_steamclient
|
||||
|
||||
# Steam's install metadata; not needed at runtime.
|
||||
rm --recursive --force "${INSTALL_DIR}/steamapps"
|
||||
|
||||
Reference in new issue
Block a user