-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_patch.ps1
More file actions
72 lines (57 loc) · 1.95 KB
/
build_patch.ps1
File metadata and controls
72 lines (57 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Param(
[string]$BuildType="Auto",
[string]$SourceBranch="release",
[string]$PatchName="Open Beta 5.1234", # TODO: make non-optional
[int]$TargetRevision=0,
[switch]$Jenkins
)
# Constants
$UdkUrl = "svn://svn.renegade-x.com/svn/main/UDK_Uncooked"
$RootDir = (Get-Location).ProviderPath
$UdkPath = "$RootDir\UDK_Uncooked"
$BuildPath = "$UdkPath\build"
### STAGE 1: Prepare Workspace
# Requires: UdkPath, UdkUrl, TargetRevision, RootDir, BuildPath
function PrepSVN {
Param(
[string]$UdkPath,
[string]$UdkUrl,
[int]$TargetRevision
)
if (![System.IO.Directory]::Exists("$UdkPath")) {
Write-Host "Checking out UDK_Uncooked..."
svn checkout $UdkUrl
}
# Revert any local changes
svn revert --recursive $UdkPath
# Update UDK to latest revision
if ($TargetRevision -eq 0) {
svn update $UdkPath
}
else {
svn update -r $TargetRevision $UdkPath
}
}
# Checkout/update SVN to target revision
PrepSVN "$UdkPath" "$UdkUrl" "$TargetRevision"
. "$BuildPath\scripts\common.ps1"
# Prepare RootDir for build
PrepRootDir "$RootDir"
### STAGE 2: Build
# Requires: BuildPath, SourceBranch, BuildType, UdkPath
# Pull config data if type Auto
$BuildType = (GetBuildType "$BuildPath" "$SourceBranch" -BuildType "$BuildType")
# Build UDK
BuildUdk "$UdkPath" "$BuildType"
### STAGE 3: Make patch
# Requires: RootDir, UdkPath, BuildType, PatchName, SourceBranch
# Make patch data
$PatchDataName = (MakePatchData "$RootDir" "$UdkPath" "$BuildType" "$PatchName" "$SourceBranch" -DeleteBuild)
echo "PatchDataName: $PatchDataName"
### STAGE 4: Publish patch
# Requires: Env:SSHKey, Env:SSHUsername, RootDir, PatchDataName
# Publish patch data
if ($Jenkins) {
PublishPatchData $Env:SSHKey $Env:SSHUsername "vcs.glitchware.com:/home/renx/patches/data/" "$RootDir\$PatchDataName"
echo "Build complete. Run the `"Set Game Version`" Jenkins plan to point the appropriate branch to $PatchDataName"
}