Define the buildTarget function outside of the Jenkins pipeline

This commit is contained in:
Username404 2021-08-15 16:17:10 +02:00
parent 28fcc49572
commit 42ae8e1342
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 7 additions and 7 deletions

14
Jenkinsfile vendored
View File

@ -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')