Add a boolean parameter to the buildTarget function of the Jenkinsfile to choose whether to use the debian architecture or the rpm architecture in the names of produced packages

This commit is contained in:
Username404 2021-08-15 21:19:05 +02:00
parent 58e54f1b94
commit b8b809a876
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 4 additions and 3 deletions

7
Jenkinsfile vendored
View File

@ -1,6 +1,7 @@
def buildTarget(String path, String rpmArch, String debArch) { def buildTarget(String path, String rpmArch, String debArch, String isPackageArchDeb = true) {
String packageArch = isPackageArchDeb ? debArch : rpmArch;
cmakeBuild buildDir: "cmake-build-${debArch}", buildType: 'release', cleanBuild: true, installation: 'Main', cmakeBuild buildDir: "cmake-build-${debArch}", buildType: 'release', cleanBuild: true, 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} -DCXX_TARGET=${debArch}" 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} -DCXX_TARGET=${packageArch}"
cmake arguments: "--build ./cmake-build-${debArch} --target ybcon", installation: 'Main' cmake arguments: "--build ./cmake-build-${debArch} --target ybcon", installation: 'Main'
cpack installation: 'Main', workingDir: "cmake-build-${debArch}" cpack installation: 'Main', workingDir: "cmake-build-${debArch}"
} }
@ -29,7 +30,7 @@ pipeline { // Multi-branch pipeline script for Yerbacon.
cpack installation: 'Main', workingDir: 'cmake-build-release' cpack installation: 'Main', workingDir: 'cmake-build-release'
buildTarget('arm-linux-gnueabi', 'armv4l', 'armel') buildTarget('arm-linux-gnueabi', 'armv4l', 'armel')
buildTarget('arm-linux-gnueabihf', 'armv7hl', 'armhf') buildTarget('arm-linux-gnueabihf', 'armv7hl', 'armhf')
buildTarget('aarch64-linux-gnu', 'aarch64', 'arm64') buildTarget('aarch64-linux-gnu', 'aarch64', 'arm64', false)
} }
} }
stage('Build for other platforms') { stage('Build for other platforms') {