def REPO = 'ssh://gerrit1.techsat.local:29418/external/Qt' node ('build6-win10-64') { stage('Prepare environment') { result = sh returnStatus: true, script: ''' CWD=`pwd` export WORKSPACE=`cygpath $WORKSPACE` rm -Rf $WORKSPACE/* ''' if (result != 0) { echo '[FAILURE] Failed to build' currentBuild.result = 'FAILURE' sh "exit ${result}" } } stage('Prepare environment') { checkout([$class: 'GitSCM', branches: [[name: 'master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: REPO]]]) step ([$class: 'CopyArtifact', projectName: '202151_NG_ADS2-Tools-GCC-Suite', filter: 'gcc-suite-*-x86-mingw64.zip']); result = sh returnStatus: true, script: ''' echo $HOME pwd mkdir Qt-5.9.1 unzip gcc-suite-*-x86-mingw64.zip rm -f gcc-suite-*-x86-mingw64.zip mv gcc-* gcc ''' if (result != 0) { echo '[FAILURE] Failed to build' currentBuild.result = 'FAILURE' sh "exit ${result}" } } stage('unzip qt') { result = sh returnStatus: true, script: ''' TOP=`pwd` cd SOURCE /c/"Program Files"/7-Zip/7z.exe x qt-everywhere-opensource-src-*.zip -o.. -y -r cd .. ''' if (result != 0) { echo '[FAILURE] Failed to build' currentBuild.result = 'FAILURE' sh "exit ${result}" } } stage('configure qt') { result = sh returnStatus: true, script: ''' TOP=`pwd` export WORKSPACE=`cygpath $WORKSPACE` P=`cygpath $DSB_PKGS/x86-mingw64/msys/usr/bin` export PATH=$WORKSPACE/gcc/bin:$P hash -r gcc hash -r g++ gcc --version cp -f $WORKSPACE/SOURCE/win32-g++.nativ.qmake.conf $WORKSPACE/qt-everywhere-opensource-src-5.9.1/qtbase/mkspecs/win32-g++/qmake.conf cd $WORKSPACE/qt-everywhere-opensource-src-5.9.1 ./configure -prefix $WORKSPACE/Qt-5.9.1 -release -opensource -confirm-license -optimized-tools -strip -platform win32-g++ -opengl desktop -nomake tests ''' if (result != 0) { echo '[FAILURE] Failed to build' currentBuild.result = 'FAILURE' sh "exit ${result}" } } stage('build qt') { result = sh returnStatus: true, script: ''' export WORKSPACE=`cygpath $WORKSPACE` cd $WORKSPACE TOP=`pwd` P=`cygpath $DSB_PKGS/x86-mingw64/msys/usr/bin` export PATH=$WORKSPACE/gcc-7.1.0/bin:$P hash -r gcc hash -r g++ gcc --version cd qt-everywhere-opensource-src-5.9.1 make -j2 ''' if (result != 0) { echo '[FAILURE] Failed to build' currentBuild.result = 'FAILURE' sh "exit ${result}" } } stage('install qt') { result = sh returnStatus: true, script: ''' export WORKSPACE=`cygpath $WORKSPACE` TOP=`pwd` P=`cygpath $DSB_PKGS/x86-mingw64/msys/usr/bin` export PATH=$WORKSPACE/gcc-7.1.0/bin:$P hash -r gcc hash -r g++ gcc --version cd qt-everywhere-opensource-src-5.9.1 make -i install ''' if (result != 0) { echo '[FAILURE] Failed to build' currentBuild.result = 'FAILURE' sh "exit ${result}" } } }