From 42ae8e134218bf58adb7c8d51389ce1392bec007 Mon Sep 17 00:00:00 2001 From: Username404 Date: Sun, 15 Aug 2021 16:17:10 +0200 Subject: [PATCH] Define the buildTarget function outside of the Jenkins pipeline --- Jenkinsfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6ed85ad..0bf2c21 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,13 +1,13 @@ +def buildTarget(String path, String rpmArch, String debArch) { + cmakeBuild buildDir: 'cmake-build-${debArch}', buildType: 'release', cleanBuild: true, installation: 'Main' + cmake arguments: '--build ./cmake-build-${debArch} --target ybcon', installation: 'Main', + cmakeArgs: '-DCMAKE_C_COMPILER=/usr/bin/${path}-gcc -DCMAKE_CXX_COMPILER=/usr/bin/${path}-g++ -DCMAKE_LINKER=/usr/bin/${path}-ld.gold -DCMAKE_AR=/usr/bin/${path}-ar -DCPACK_RPM_PACKAGE_ARCHITECTURE=${rpmArch} -DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=${debArch}' + cpack installation: 'Main', workingDir: 'cmake-build-{debArch}' +} + pipeline { // Multi-branch pipeline script for Yerbacon. agent any - def buildTarget(String path, String rpmArch, String debArch) { - cmakeBuild buildDir: 'cmake-build-${debArch}', buildType: 'release', cleanBuild: true, installation: 'Main' - cmake arguments: '--build ./cmake-build-${debArch} --target ybcon', installation: 'Main', - cmakeArgs: '-DCMAKE_C_COMPILER=/usr/bin/${path}-gcc -DCMAKE_CXX_COMPILER=/usr/bin/${path}-g++ -DCMAKE_LINKER=/usr/bin/${path}-ld.gold -DCMAKE_AR=/usr/bin/${path}-ar -DCPACK_RPM_PACKAGE_ARCHITECTURE=${rpmArch} -DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=${debArch}' - cpack installation: 'Main', workingDir: 'cmake-build-{debArch}' - } - options { buildDiscarder(logRotator(numToKeepStr: '48', artifactNumToKeepStr: '96')) timeout(time: 8, unit: 'MINUTES')