diff --git a/craft-cache/devel-pipelines/windows.pipeline b/craft-cache/devel-pipelines/windows.pipeline index 5f0e14e..3993a1f 100644 --- a/craft-cache/devel-pipelines/windows.pipeline +++ b/craft-cache/devel-pipelines/windows.pipeline @@ -1,78 +1,81 @@ // Where will the craftmaster configuration be found (relative to the working directory that is)? def craftmasterConfigDir = "binary-factory-tooling/craft/configs/master/" // Request a node to be allocated to us node( "WindowsMSVC" ) { // We want Timestamps on everything timestamps { // We want to catch any errors that occur to allow us to send out notifications (ie. emails) if needed catchError { // First we want to make sure Craft is ready to go stage('Preparing Craft') { // Make sure we start with a clean slate deleteDir() // Grab our tooling which we will need in a few moments checkout changelog: false, poll: false, scm: [ $class: 'GitSCM', branches: [[name: 'master']], extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'bf-tooling/']], userRemoteConfigs: [[url: 'https://anongit.kde.org/sysadmin/binary-factory-tooling']] ] // We are also reliant on the CI System Tooling for parts of this, so grab it too checkout changelog: false, poll: false, scm: [ $class: 'GitSCM', branches: [[name: 'master']], extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'ci-tooling/']], userRemoteConfigs: [[url: 'https://anongit.kde.org/sysadmin/ci-tooling']] ] // Make sure that Craftmaster is ready to go bat """ python "%WORKSPACE%\\bf-tooling\\craft\\checkout-repository.py" --repository "git://anongit.kde.org/craftmaster" --into "C:/Craft/BinaryCache/" python "%WORKSPACE%\\bf-tooling\\craft\\checkout-repository.py" --repository "git://anongit.kde.org/sysadmin/binary-factory-tooling" --into "C:/Craft/BinaryCache/" """ } // Now that is done, it's time to rebuild the Craft Cache! stage('Build Craft Cache') { bat """ cd C:/Craft/BinaryCache/ + python craftmaster/Craftmaster.py --config ${craftmasterConfigDir}/CraftBinaryCache.ini --target ${craftPlatform} --variables CreateCache=True UseCache=True -c -i craft + if errorlevel 1 exit /b %errorlevel% + python craftmaster/Craftmaster.py --config ${craftmasterConfigDir}/CraftBinaryCache.ini --target ${craftPlatform} --variables CreateCache=True UseCache=True -c --option "/.buildTests=False" --list-file ${craftmasterConfigDir}/BinaryCachePackagesBase.list if errorlevel 1 exit /b %errorlevel% + if not "${craftPlatform}" == "windows-msvc2017_32-cl" ( python craftmaster/Craftmaster.py --config ${craftmasterConfigDir}/CraftBinaryCache.ini --target ${craftPlatform} --variables CreateCache=True UseCache=True -c --option "/.buildTests=False" --list-file ${craftmasterConfigDir}/BinaryCachePackages.list - if errorlevel 1 exit /b %errorlevel% + if !errorlevel! neq 0 exit /b !errorlevel! ) - if errorlevel 1 exit /b %errorlevel% """ } } // We need to catch errors here to ensure that the cleanup always runs, even if the upload fails // While this is a bit wasteful it at least determines that errors in the publishing process leave a builder with a very full disk! catchError { // Upload it to the master server stage('Publish Craft Cache') { bat """ cd "%WORKSPACE%\\ci-tooling" python helpers/sftp-directory-mirror.py --source C:/Craft/BinaryCache/cache/ --destination /srv/archives/files/craft/master/ --server milonia.kde.org --username craft """ } } // Then we can cleanup everything we did // It is critical this always happens, otherwise builders can run out of disk space! stage('Cleaning Up') { bat """ rmdir /s /q C:\\Craft\\BinaryCache\\ """ } // As the Windows Slaves are permanent ones, we erase the Workspace as the last thing we do deleteDir() } }