From 9a9cc4aa50e1eebefa9929ede9e242b1d9bb8de4 Mon Sep 17 00:00:00 2001 From: Username404 Date: Mon, 9 Aug 2021 18:02:05 +0200 Subject: [PATCH] Move cross-compilation to another stage in the Jenkinsfile. --- Jenkinsfile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 853d3c0..142511c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,11 +21,18 @@ pipeline { // Multi-branch pipeline script for Yerbacon. cmakeBuild buildDir: 'cmake-build-release-win32', buildType: 'release', cleanBuild: true, installation: 'Main', cmakeArgs: '-DCMAKE_C_COMPILER=/usr/bin/i686-w64-mingw32-gcc-posix -DCMAKE_CXX_COMPILER=/usr/bin/i686-w64-mingw32-c++-posix -DCMAKE_SYSTEM_PROCESSOR=i686' cmake arguments: '--build ./cmake-build-release --target ybcon -- -j 9', installation: 'Main' - cmake arguments: '--build ./cmake-build-release-win32 --target ybcon -- -j 9', installation: 'Main' sh 'strip ./cmake-build-*/ybcon' - catchError { cpack installation: 'Main', workingDir: 'cmake-build-release' } - catchError { cpack installation: 'Main', workingDir: 'cmake-build-release-arm' } - catchError { cpack installation: 'Main', workingDir: 'cmake-build-release-win32' } + cpack installation: 'Main', workingDir: 'cmake-build-release' + cpack installation: 'Main', workingDir: 'cmake-build-release-arm' + } + } + stage('Cross-compile') { + steps { + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + cmake arguments: '--build ./cmake-build-release-win32 --target ybcon -- -j 9', installation: 'Main' + cpack installation: 'Main', workingDir: 'cmake-build-release-win32' + dir('cmake-build-release-win32') { archiveArtifacts artifacts:'*.exe', fingerprint: false } + } } } stage('Deploy') { @@ -33,7 +40,6 @@ pipeline { // Multi-branch pipeline script for Yerbacon. echo 'Deploying....' dir('cmake-build-release') { archiveArtifacts artifacts:'*.deb, *.rpm, *.tar.gz, *.sh', fingerprint: false } dir('cmake-build-release-arm') { zip zipFile: './Yerbacon-ARM_lpkg.zip', archive: true, glob: "*.tar.gz, *.sh, *.rpm, *.deb" } - dir('cmake-build-release-win32') { archiveArtifacts artifacts:'*.exe', fingerprint: false } } } }