Puts into version control the script used by Jenkins to autobuild on Windows. Update it to use VS 2015 and Jenkins Pipeline.
This could be adapted into a script that builds patches on Windows.
Differential D1909
Version and update the Windows autobuilder script Itms on May 19 2019, 8:57 PM. Authored by
Details Puts into version control the script used by Jenkins to autobuild on Windows. Update it to use VS 2015 and Jenkins Pipeline. This could be adapted into a script that builds patches on Windows. Test that all stages of script works as intended
Diff Detail
Event TimelineThere are a very large number of changes, so older changes are hidden. Show Older Changes Comment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/differential/1463/display/redirect
Comment Actions Very nice! I'm proposing the following changes. They are either changes from the scripted pipeline syntax to declarative, or improvements that we could make to the current bat script (so, not a criticism towards your work). The only bug/puzzling thing is the absence of the repo address, which makes me think like this pipeline shouldn't work? Unless you checked the repo out manually once?
Comment Actions I need help, or this is going to be without tests: Comment Actions Here is my version of the script. Builds debug and release and the tests def atlasPrj = "" def output = "" def jobs = "8" def atlasOption = "" def glooxOption = "--use-shared-glooxwrapper" pipeline { agent { label 'WindowsSlave' } stages { stage("Checkout") { options { retry(3) } steps { script { try { svn "https://svn.wildfiregames.com/public/ps/trunk" } catch(e) { bat "svn cleanup" sleep 300 throw e } } bat "svn cleanup" } } stage('Setup workspace') { steps { bat 'robocopy /MIR C:\\wxwidgets3.0.2\\lib libraries\\win32\\wxwidgets\\lib & IF %ERRORLEVEL% LEQ 1 exit 0' bat 'robocopy /MIR C:\\wxwidgets3.0.2\\include libraries\\win32\\wxwidgets\\include & IF %ERRORLEVEL% LEQ 1 exit 0' script { if (env.atlas.toBoolean() == true) { atlasPrj = ";AtlasUI" atlasOption = "--atlas" bat "del binaries\\system\\AtlasUI.dll" echo "atlas is enabled" } if (env.gloox.toBoolean() == true) { bat "del binaries\\system\\glooxwrapper.pdb binaries\\system\\glooxwrapper.lib binaries\\system\\glooxwrapper.dll" glooxOption = "--build-shared-glooxwrapper" echo "gloox is enabled" } if(env.collada.toBoolean() == true) { bat "del binaries\\system\\Collada.dll" echo "collada is enabled" } bat "cd build\\premake && if not exist ..\\workspaces\\vc2015\\SKIP_PREMAKE_HERE premake5\\bin\\release\\premake5 --outpath=\"..\\workspaces\\vc2015\" ${atlasOption} ${glooxOption} --large-address-aware --jenkins-tests%* vs2015" bat 'del binaries\\system\\pyrogenesis.pdb' bat 'del binaries\\system\\pyrogenesis_dbg.exe' bat 'del binaries\\system\\pyrogenesis.exe' bat 'del binaries\\system\\test_dbg.exe' bat 'del binaries\\system\\test.exe' output = bat(returnStdout: true, script: 'svnversion source -n').trim() output = output.readLines().drop(1).join("") } bat "echo L\"${output}\" > build\\svn_revision\\svn_revision.txt" } } stage ('Build') { steps { bat "cd build\\workspaces\\vc2015 && MSBuild.exe pyrogenesis.sln -m:${jobs} -t:pyrogenesis;test%atlasPrj% -clp:Warningsonly -clp:ErrorsOnly -p:Configuration=\"Release\"" bat "cd build\\workspaces\\vc2015 && MSBuild.exe pyrogenesis.sln -m:${jobs} -t:pyrogenesis;test%atlasPrj% -clp:Warningsonly -clp:ErrorsOnly -p:Configuration=\"Debug\"" } } stage ('Tests') { steps { script { bat 'del .\\cxxtest_debug.xml' bat 'del .\\cxxtest_release.xml' bat 'binaries\\system\\test_dbg.exe > cxxtest_debug.xml' bat 'binaries\\system\\test.exe > cxxtest_release.xml' } } post { always { junit "cxxtest_*.xml" } } } stage ('Commit') { steps { bat "svn changelist --remove --recursive --cl commit" script { if (env.pyrogenesis.toBoolean() == true) { bat "svn changelist commit binaries\\system\\pyrogenesis.pdb binaries\\system\\pyrogenesis.exe" } if (env.atlas.toBoolean() == true) { bat "svn changelist commit binaries\\system\\AtlasUI.dll" } if (env.collada.toBoolean() == true) { bat "svn changelist commit binaries\\system\\Collada.dll" } if (env.gloox.toBoolean() == true) { bat "svn changelist commit binaries\\system\\glooxwrapper.dll binaries\\system\\glooxwrapper.lib binaries\\system\\glooxwrapper.pdb" } } bat 'svn ci --changelist commit --non-interactive -m "[Windows] Automated build."' } } } post { always { bat "svn revert -R ." } } } I had the same issue as @Angen with the test not running, it seems a system account doesn't have sufficient privileges to run them... Also the build won't run if the repo is in a specific folder with spaces such as program files. I also added
Comment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/differential/1580/display/redirect Comment Actions Good work! I am currently testing the pipeline on the autobuilder with the following changes. Side note: I am wondering about the deletion of binaries that we already performed in the previous script. It doesn't seem needed since we create a changelist properly... What do you think Angen?
Comment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/differential/1585/display/redirect
Comment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/differential/1588/display/redirect Comment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/differential/1598/display/redirect |