From 5b52e7e570d031875a71208027e9395dc30e37a0 Mon Sep 17 00:00:00 2001 From: sholdee <102821812+sholdee@users.noreply.github.com> Date: Fri, 29 Apr 2022 16:11:38 -0500 Subject: [PATCH] Commit Jenkinsfile to develop --- Jenkinsfile | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..fa68703b2 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,99 @@ +pipeline { + + environment { + MSBUILD='C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Msbuild\\Current\\Bin\\msbuild.exe' + CONFIG='Release' + OTRPLATFORM='x64' + PLATFORM='x86' + ZIP='C:\\Program Files\\7-Zip\\7z.exe' + PYTHON='C:\\Users\\jenkins\\AppData\\Local\\Programs\\Python\\Python310\\python.exe' + TOOLSET='v142' + EMAILTO='' + } + + agent { + label 'SoH-Builders' + } + + options { + timestamps() + timeout(time: 15, unit: 'MINUTES') + skipDefaultCheckout(true) + } + + stages { + + stage ('Checkout') { + steps { + checkout([ + $class: 'GitSCM', + branches: scm.branches, + doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, + extensions: scm.extensions, + userRemoteConfigs: scm.userRemoteConfigs + ]) + } + } + + stage ('Build OTRExporter') { + steps { + bat """ + + "${env.MSBUILD}" ".\\OTRExporter\\OTRExporter.sln" -t:restore,build -p:Configuration=${env.CONFIG};Platform=${env.OTRPLATFORM};PlatformToolset=${env.TOOLSET};RestorePackagesConfig=true /nodeReuse:false + + """ + } + } + + stage ('Extract assets') { + steps { + bat """ + + xcopy "..\\..\\ZELOOTD.z64" "OTRExporter\\" + + cd "OTRExporter" + "${env.PYTHON}" ".\\extract_assets.py" + cd "${env.WORKSPACE}" + + """ + } + } + + stage ('Build SoH') { + steps { + bat """ + + "${env.MSBUILD}" ".\\soh\\soh.sln" -t:build -p:Configuration=${env.CONFIG};Platform=${env.PLATFORM};PlatformToolset=${env.TOOLSET} /nodeReuse:false + + """ + } + } + + stage ('Archive artifacts') { + steps { + bat """ + + "${env.ZIP}" a "soh.zip" ".\\soh\\Release\\soh.exe" + + """ + + archiveArtifacts allowEmptyArchive: false, + artifacts: 'soh.zip', + caseSensitive: true, + defaultExcludes: true, + fingerprint: false, + onlyIfSuccessful: true + } + } + } + + post { + always { + step([$class: 'Mailer', + notifyEveryUnstableBuild: true, + recipients: "${env.EMAILTO}", + sendToIndividuals: false]) + step([$class: 'WsCleanup']) // Clean workspace + } + } +}