Document dedicated server and tile delivery builds
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
set "PROJECT_DIR=%~dp0.."
|
||||
set "PROJECT_FILE=%PROJECT_DIR%\AgrarianGame.uproject"
|
||||
set "UE_ROOT=C:\Program Files\Epic Games\UE_5.7"
|
||||
set "RUN_UAT=%UE_ROOT%\Engine\Build\BatchFiles\RunUAT.bat"
|
||||
set "BUILD_BAT=%UE_ROOT%\Engine\Build\BatchFiles\Build.bat"
|
||||
set "ARCHIVE_DIR=%PROJECT_DIR%\Builds\LinuxServerDevelopment"
|
||||
set "LOG_DIR=%PROJECT_DIR%\Saved\BuildLogs"
|
||||
set "LOG_FILE=%LOG_DIR%\BuildLinuxDedicatedServer.log"
|
||||
set "TARGET_MAP=/Game/Agrarian/Maps/L_GroundZeroTerrain_Test"
|
||||
|
||||
if not exist "%LOG_DIR%" mkdir "%LOG_DIR%"
|
||||
if not exist "%ARCHIVE_DIR%" mkdir "%ARCHIVE_DIR%"
|
||||
|
||||
if not exist "%BUILD_BAT%" (
|
||||
echo Unreal Engine 5.7 Build.bat was not found at:
|
||||
echo %BUILD_BAT%
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
if not exist "%RUN_UAT%" (
|
||||
echo Unreal Engine 5.7 RunUAT was not found at:
|
||||
echo %RUN_UAT%
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
if not exist "%PROJECT_FILE%" (
|
||||
echo Project file was not found at:
|
||||
echo %PROJECT_FILE%
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Building Agrarian Linux dedicated server...
|
||||
echo Archive: %ARCHIVE_DIR%
|
||||
echo Log: %LOG_FILE%
|
||||
echo.
|
||||
echo This requires Epic's Linux cross-compile toolchain for Unreal 5.7 on Windows-Builder.
|
||||
echo.
|
||||
|
||||
call "%BUILD_BAT%" AgrarianGameServer Linux Development -Project="%PROJECT_FILE%" -WaitMutex -NoUBA > "%LOG_FILE%" 2>&1
|
||||
set "BUILD_EXIT_CODE=%ERRORLEVEL%"
|
||||
type "%LOG_FILE%"
|
||||
|
||||
if not "%BUILD_EXIT_CODE%"=="0" (
|
||||
echo.
|
||||
echo Dedicated server target build failed with exit code %BUILD_EXIT_CODE%.
|
||||
echo Log file: %LOG_FILE%
|
||||
exit /b %BUILD_EXIT_CODE%
|
||||
)
|
||||
|
||||
call "%RUN_UAT%" BuildCookRun ^
|
||||
-project="%PROJECT_FILE%" ^
|
||||
-noP4 ^
|
||||
-server ^
|
||||
-serverplatform=Linux ^
|
||||
-serverconfig=Development ^
|
||||
-noclient ^
|
||||
-build ^
|
||||
-cook ^
|
||||
-stage ^
|
||||
-pak ^
|
||||
-archive ^
|
||||
-archivedirectory="%ARCHIVE_DIR%" ^
|
||||
-map=%TARGET_MAP% ^
|
||||
-utf8output ^
|
||||
-NoUBA >> "%LOG_FILE%" 2>&1
|
||||
|
||||
set "PACKAGE_EXIT_CODE=%ERRORLEVEL%"
|
||||
type "%LOG_FILE%"
|
||||
|
||||
if not "%PACKAGE_EXIT_CODE%"=="0" (
|
||||
echo.
|
||||
echo Dedicated server package failed with exit code %PACKAGE_EXIT_CODE%.
|
||||
echo Log file: %LOG_FILE%
|
||||
exit /b %PACKAGE_EXIT_CODE%
|
||||
)
|
||||
|
||||
echo.
|
||||
echo Linux dedicated server package completed successfully.
|
||||
echo Archive: %ARCHIVE_DIR%
|
||||
echo.
|
||||
exit /b 0
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
TILE_ID="${AGRARIAN_TILE_ID:-gz_us_ca_pacifica_utm10n_e544_n4160}"
|
||||
PACKAGE_VERSION="${AGRARIAN_TILE_PACKAGE_VERSION:-0}"
|
||||
BUILD_ROOT="${PROJECT_ROOT}/BuildArtifacts/TileDelivery"
|
||||
PUBLIC_ROOT="${BUILD_ROOT}/public"
|
||||
PACKAGE_ROOT="${PUBLIC_ROOT}/tiles/${TILE_ID}/v${PACKAGE_VERSION}"
|
||||
ARCHIVE_PATH="${BUILD_ROOT}/agrarian-ground-zero-tile-delivery.tar.gz"
|
||||
|
||||
log() {
|
||||
printf '[agrarian-tile-package] %s\n' "$*"
|
||||
}
|
||||
|
||||
require_file() {
|
||||
local path="$1"
|
||||
if [[ ! -f "${path}" ]]; then
|
||||
printf 'Missing required file: %s\n' "${path}" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
REGISTRY="${PROJECT_ROOT}/Data/Tiles/ground_zero_tiles.json"
|
||||
SCHEMA="${PROJECT_ROOT}/Data/Tiles/tile_registry.schema.json"
|
||||
HEIGHTMAP="${PROJECT_ROOT}/Data/Terrain/Unreal/${TILE_ID}/${TILE_ID}_unreal_1009.r16"
|
||||
HEIGHTMAP_META="${PROJECT_ROOT}/Data/Terrain/Unreal/${TILE_ID}/${TILE_ID}_unreal_heightmap_metadata.json"
|
||||
TERRAIN_META="${PROJECT_ROOT}/Data/Terrain/Generated/${TILE_ID}/${TILE_ID}_terrain_metadata.json"
|
||||
LANDFORM="${PROJECT_ROOT}/Data/Terrain/Analysis/${TILE_ID}/${TILE_ID}_landform_analysis.json"
|
||||
WATER="${PROJECT_ROOT}/Data/Terrain/Analysis/${TILE_ID}/${TILE_ID}_water_shoreline_analysis.json"
|
||||
EDGES="${PROJECT_ROOT}/Data/Terrain/Analysis/${TILE_ID}/${TILE_ID}_neighbor_edge_verification.json"
|
||||
|
||||
require_file "${REGISTRY}"
|
||||
require_file "${SCHEMA}"
|
||||
require_file "${HEIGHTMAP}"
|
||||
require_file "${HEIGHTMAP_META}"
|
||||
require_file "${TERRAIN_META}"
|
||||
require_file "${LANDFORM}"
|
||||
require_file "${WATER}"
|
||||
require_file "${EDGES}"
|
||||
|
||||
rm -rf "${BUILD_ROOT}"
|
||||
mkdir -p "${PACKAGE_ROOT}/terrain" "${PUBLIC_ROOT}/schemas"
|
||||
|
||||
cp "${REGISTRY}" "${PUBLIC_ROOT}/ground_zero_tiles.json"
|
||||
cp "${SCHEMA}" "${PUBLIC_ROOT}/schemas/tile_registry.schema.json"
|
||||
cp "${HEIGHTMAP}" "${PACKAGE_ROOT}/terrain/"
|
||||
cp "${HEIGHTMAP_META}" "${PACKAGE_ROOT}/terrain/"
|
||||
cp "${TERRAIN_META}" "${PACKAGE_ROOT}/terrain/"
|
||||
cp "${LANDFORM}" "${PACKAGE_ROOT}/terrain/"
|
||||
cp "${WATER}" "${PACKAGE_ROOT}/terrain/"
|
||||
cp "${EDGES}" "${PACKAGE_ROOT}/terrain/"
|
||||
|
||||
cat > "${PUBLIC_ROOT}/manifest.json" <<JSON
|
||||
{
|
||||
"service": "agrarian-tile-delivery",
|
||||
"schema_version": 1,
|
||||
"environment": "mvp",
|
||||
"default_tile_id": "${TILE_ID}",
|
||||
"tiles_registry": "/ground_zero_tiles.json",
|
||||
"tile_packages": [
|
||||
{
|
||||
"tile_id": "${TILE_ID}",
|
||||
"package_version": ${PACKAGE_VERSION},
|
||||
"status": "mvp_static_package",
|
||||
"base_url": "/tiles/${TILE_ID}/v${PACKAGE_VERSION}/",
|
||||
"terrain": {
|
||||
"heightmap_r16": "terrain/${TILE_ID}_unreal_1009.r16",
|
||||
"heightmap_metadata": "terrain/${TILE_ID}_unreal_heightmap_metadata.json",
|
||||
"terrain_metadata": "terrain/${TILE_ID}_terrain_metadata.json",
|
||||
"landform_analysis": "terrain/${TILE_ID}_landform_analysis.json",
|
||||
"water_shoreline_analysis": "terrain/${TILE_ID}_water_shoreline_analysis.json",
|
||||
"neighbor_edge_verification": "terrain/${TILE_ID}_neighbor_edge_verification.json"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
JSON
|
||||
|
||||
(
|
||||
cd "${PUBLIC_ROOT}"
|
||||
find . -type f ! -name SHA256SUMS -print0 | sort -z | xargs -0 sha256sum > SHA256SUMS
|
||||
)
|
||||
|
||||
# The project usually lives on a CIFS-mounted Unraid share. Give copied files a
|
||||
# short settle window before tar reads them, or GNU tar can report false
|
||||
# "file changed as we read it" warnings on the network filesystem.
|
||||
sleep 3
|
||||
|
||||
tar -C "${PUBLIC_ROOT}" -czf "${ARCHIVE_PATH}" .
|
||||
|
||||
log "Package complete: ${ARCHIVE_PATH}"
|
||||
log "Static root: ${PUBLIC_ROOT}"
|
||||
log "Manifest: ${PUBLIC_ROOT}/manifest.json"
|
||||
Reference in New Issue
Block a user