import jenkins.model.* import hudson.model.Result def REPO = 'ssh://gerrit1.techsat.local:29418/external/Qt' properties([ parameters([ gitParameter(branch: '', branchFilter: 'origin/(.*)', defaultValue: 'master', description: '', name: 'BRANCH', quickFilterEnabled: false, selectedValue: 'NONE', sortMode: 'NONE', tagFilter: '*', type: 'PT_BRANCH_TAG') ]) ]) stage('Build') { parallel linux: { node('bslp02-centos6-64') { deleteDir() checkout([$class: 'GitSCM', branches: [[name: BRANCH]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: REPO]]]) stage("Linux 64 Bit Build") { sh '''#!/bin/bash GCC_PATH=/master/DEV-Tools/gcc-suite/1.3.0/x86-linux64/gcc-8.2.0 make ''' } } }, windows: { node('bslp05-win10-64') { try { deleteDir() checkout([$class: 'GitSCM', branches: [[name: BRANCH]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: REPO]]]) stage ("Windows 64 Bit MinGW Build") { sh ''' echo "Cleanup prev. builds ..." WS=$(cygpath $WORKSPACE) rm -f openssl-1.0.2r/NUL rm -Rf openssl-1.0.2r echo "Done." cp -Rvf /c/dev-tools/gcc-suite/1.3.0/x86-mingw64/gcc-8.2.0 $WS/ export PATH=$WS/gcc-8.2.0/bin:/c/dev-tools/msys/x86/usr/bin:$PATH export CC=$WS/gcc-8.2.0/bin/gcc export CXX=$WS/gcc-8.2.0/bin/g++ gcc -v make -f Makefile.mingw64 all rm -Rf build.$(ARCH) rm -Rf install.$(ARCH) ''' } stage ("Windows 64 Bit MSVC Build") { sh ''' rm -f openssl-1.0.2r/NUL rm -Rf openssl-1.0.2r ''' bat '''@echo off set SDKDIR=C:\\dev-tools\\WinSDK\\VS2019BT\\ set NASMDIR=C:\\dev-tools\\nasm\\2.12.01_64 set MSYSDIR=C:\\dev-tools\\msys\\x86\\ set PERLDIR=C:\\dev-tools\\perl\\x86_64-msvc\\ set PATH=%PATH%;C:\\dev-tools\\Python\\2.7\\x86-windows\\ buildqt64.bat ''' } stash name: "qtwin", includes: "*-msvc.zip, *-x86-mingw64.tgz" } catch (e) { echo 'Windows build failed' setBuildResult('FAILURE') } finally { sh ''' export PATH=/c/dev-tools/msys/x86/usr/bin rm -Rf openssl-1.0.2r cd $WORKSPACE ''' } } } } stage ("Post processing") { node('bslp02-centos6-64') { unstash name: 'qtwin' sh ''' QT_VER=5.12.3 # # cleanup temporary destination folder for final distribution ... # unpack Linux archives ... mkdir -p $WORKSPACE/INST/$QT_VER/x86-linux64-shared tar -xzf $WORKSPACE/qt-$QT_VER-shared-x86-linux64.tgz -C $WORKSPACE/INST/$QT_VER/x86-linux64-shared mkdir -p $WORKSPACE/INST/$QT_VER/x86-linux64-static tar -xzf $WORKSPACE/qt-$QT_VER-static-x86-linux64.tgz -C $WORKSPACE/INST/$QT_VER/x86-linux64-static mkdir -p $WORKSPACE/INST/$QT_VER/x86_64-msvc unzip -o $WORKSPACE/qt-$QT_VER-x86_64-msvc.zip -d $WORKSPACE/INST/$QT_VER/x86_64-msvc mkdir -p $WORKSPACE/INST/$QT_VER/x86-mingw64 tar -xzf $WORKSPACE/qt-$QT_VER-x86-mingw64.tgz -C $WORKSPACE/INST/$QT_VER/x86-mingw64 mkdir -p $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin cp -f $WORKSPACE/INST/$QT_VER/x86-linux64-static/bin/* $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin # # finally create the whole archive ... cd $WORKSPACE/INST && tar -zcf $WORKSPACE/qt-$QT_VER-bin_64.tgz ./ rm -Rf $WORKSPACE/INST ''' archiveArtifacts artifacts: '*.tgz, *.zip' } }