Changeset View
Standalone View
build/jenkins/win_autobuild.Jenkinsfile
def AtlasPrj = "" | |||||
def output = "" | |||||
pipeline { | |||||
agent { label 'WindowsSlave' } | |||||
stages { | |||||
stage("Checkout") { | |||||
options { | |||||
Itms: Adding a `parameters` section is a good habit, it allows them to be documented in the pipeline… | |||||
retry(3) | |||||
} | |||||
steps { | |||||
script { | |||||
try { | |||||
svn "https://svn.wildfiregames.com/public/ps/trunk" | |||||
} catch(e) { | |||||
bat "svn cleanup" | |||||
sleep 300 | |||||
Not Done Inline ActionsI'm using the https://svn.wildfiregames.com/public/ps/trunk in order to be able to commit. Itms: I'm using the `https://svn.wildfiregames.com/public/ps/trunk` in order to be able to commit. | |||||
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' | |||||
bat "cd build\\workspaces && update-workspaces.bat --atlas --build-shared-glooxwrapper --large-address-aware --jenkins-tests" | |||||
bat "del binaries\\system\\pyrogenesis.pdb binaries\\system\\pyrogenesis.exe" | |||||
script { | |||||
if (env.atlas.toBoolean() == true) { | |||||
AtlasPrj = "/t:AtlasUI" | |||||
bat "del binaries\\system\\AtlasUI.dll" | |||||
Not Done Inline ActionsI have built the newer version 3.0.4 on the autobuilder. Itms: I have built the newer version 3.0.4 on the autobuilder. | |||||
echo "atlas is enabled" | |||||
Done Inline ActionsI had forgotten to copy the files at the correct location and this didn't fail properly. I got 2019/06/02 15:56:28 ERROR 3 (0x00000003) Accessing Source Directory C:\wxwidgets3.0.4\lib\ The system cannot find the path specified. but the build wasn't marked as failed. Itms: I had forgotten to copy the files at the correct location and this didn't fail properly. I got… | |||||
Done Inline Actionsfixed: & -> ^& Silier: fixed: & -> ^& | |||||
} | |||||
if (env.gloox.toBoolean() == true) { | |||||
bat "del binaries\\system\\glooxwrapper.pdb binaries\\system\\glooxwrapper.lib binaries\\system\\glooxwrapper.dll" | |||||
echo "gloox is enabled" | |||||
} | |||||
if(env.collada.toBoolean() == true) { | |||||
bat "del binaries\\system\\Collada.dll" | |||||
echo "collada is enabled" | |||||
} | |||||
Not Done Inline Actionsextra space Itms: extra space | |||||
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') { | |||||
Not Done Inline ActionsI am not going to send the test results to Jenkins for the autobuilder, so I'm removing --jenkins-tests. This will be useful when writing a pipeline for testing patches though. Itms: I am not going to send the test results to Jenkins for the autobuilder, so I'm removing `… | |||||
steps { | |||||
bat 'cd build\\workspaces\\vc2015 && MSBuild.exe pyrogenesis.sln /m /t:pyrogenesis %AtlasPrj% /t:test /p:Configuration="Release"' | |||||
} | |||||
} | |||||
stage ('Tests') { | |||||
steps { | |||||
// does not work here, works in batch file called from cmd | |||||
Not Done Inline Actionsremoved the debug build, also useful for patches Itms: removed the debug build, also useful for patches | |||||
Not Done Inline ActionsIt's a bit irritating not to know when the build is likely to finish, so I removed -clp:Warningsonly -clp:ErrorsOnly in order to have the build output along the way. Itms: It's a bit irritating not to know when the build is likely to finish, so I removed `-clp… | |||||
bat 'binaries\\system\\test > cxxtest_release.xml' | |||||
} | |||||
post { | |||||
always { | |||||
junit "cxxtest_*.xml" | |||||
} | |||||
} | |||||
} | |||||
stage ('Commit') { | |||||
steps { | |||||
Not Done Inline Actionsremoved, also useful for patches Itms: removed, also useful for patches | |||||
bat "svn changelist --remove --recursive --cl commit" | |||||
Not Done Inline ActionsHum I have an issue here, the step never finishes (and I don't have the output from the tests, so maybe it actually never starts). Can you reproduce that? Itms: Hum I have an issue here, the step never finishes (and I don't have the output from the tests… | |||||
Not Done Inline ActionsThat's because the Jenkins service doesn't have enough permissions to run the tests as a system account. Msbuild is somehow whitelisted. But that means you need to run Jenkins as another user the easiest being the user that usually logs in to the machine. Stan: That's because the Jenkins service doesn't have enough permissions to run the tests as a system… | |||||
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 ." | |||||
} | |||||
} | |||||
} |
Adding a parameters section is a good habit, it allows them to be documented in the pipeline script.