Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
1.8 kB · 74 lines
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475# Remote Build Script for Azure VM# This script runs on the Azure VM to perform the build
param( [string]$p4Server, [string]$p4User, [string]$p4Password, [string]$p4Workspace, [string]$buildConfig = "Development", [string]$buildNumber = "0")
$ErrorActionPreference = "Stop"$WorkspaceRoot = "D:\Perforce"$BuildRoot = "D:\Builds"$UE5Path = "C:\Program Files\Epic Games\UE_5.4"
Write-Host "=== UE5 Remote Build ===" -ForegroundColor CyanWrite-Host "Build Number: $buildNumber"Write-Host "Configuration: $buildConfig"
# Configure PerforceWrite-Host "`nConfiguring Perforce..." -ForegroundColor Yellow$env:P4PORT = $p4Server$env:P4USER = $p4User$env:P4PASSWD = $p4Password$env:P4CLIENT = $p4Workspace
# Test connectionp4 infoif ($LASTEXITCODE -ne 0) { Write-Error "Failed to connect to Perforce" exit 1}
# Sync workspaceWrite-Host "`nSyncing workspace..." -ForegroundColor Yellowcd $WorkspaceRootp4 sync -fif ($LASTEXITCODE -ne 0) { Write-Error "Perforce sync failed" exit 1}
# Find project file$ProjectFile = Get-ChildItem -Path $WorkspaceRoot -Filter "*.uproject" -Recurse | Select-Object -First 1if (-not $ProjectFile) { Write-Error "No .uproject file found in workspace" exit 1}
Write-Host "Found project: $($ProjectFile.FullName)" -ForegroundColor Green
# BuildWrite-Host "`nStarting build..." -ForegroundColor Yellow& "$UE5Path\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun ` -project="$($ProjectFile.FullName)" ` -platform=Win64 ` -clientconfig=$buildConfig ` -cook ` -build ` -stage ` -pak ` -archive ` -archivedirectory="$BuildRoot\$buildNumber" ` -clean ` -unattended
if ($LASTEXITCODE -ne 0) { Write-Error "Build failed" exit 1}
Write-Host "`nBuild completed successfully!" -ForegroundColor Green