diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..624849f --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,23 @@ +node { + stage('Checkout') { + checkout scm + } + + stage('Acquire SE') { + bat 'powershell -File jenkins-grab-se.ps1' + bat 'rmdir GameBinaries' + bat 'mklink /J GameBinaries "C:/Steam/Data/DedicatedServer64/"' + } + + stage('Acquire NuGet Packages') { + bat 'nuget restore Torch.sln' + } + + stage('Build') { + bat "\"${tool 'MSBuild'}msbuild\" Torch.sln /p:Configuration=Release /p:Platform=x64" + } + + state('Archive') { + archive 'bin/x64/Release/Torch.*' + } +} \ No newline at end of file diff --git a/jenkins-grab-se.ps1 b/jenkins-grab-se.ps1 new file mode 100644 index 0000000..7670e02 --- /dev/null +++ b/jenkins-grab-se.ps1 @@ -0,0 +1,22 @@ +pushd + +$steamData = "C:/Steam/Data/" +$steamCMDPath = "C:/Steam/steamcmd/" +$steamCMDZip = "C:/Steam/steamcmd.zip" + +Add-Type -AssemblyName System.IO.Compression.FileSystem + +if (!(Test-Path $steamData)) { + mkdir "$steamData" +} +if (!(Test-Path $steamCMDPath)) { + if (!(Test-Path $steamCMDZip)) { + (New-Object System.Net.WebClient).DownloadFile("https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip", "$steamCMDZip"); + } + [System.IO.Compression.ZipFile]::ExtractToDirectory($steamCMDZip, $steamCMDPath) +} + +cd "$steamData" +& "$steamCMDPath/steamcmd.exe" "+login anonymous" "+force_install_dir $steamData" "+app_update 298740" "+quit" + +popd \ No newline at end of file