2021-08-16 00:24:54 +02:00
|
|
|
def buildTarget(String path, String rpmArch, String debArch, boolean isPackageArchDeb = true) {
|
2021-08-15 21:19:05 +02:00
|
|
|
String packageArch = isPackageArchDeb ? debArch : rpmArch;
|
2021-08-16 11:52:38 +02:00
|
|
|
cmakeBuild buildDir: "cmake-build-${packageArch}", buildType: 'release', cleanBuild: true, installation: 'Main',
|
2021-08-18 13:38:58 +02:00
|
|
|
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} -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS=/usr/${path}/lib/"
|
2021-08-16 11:52:38 +02:00
|
|
|
cmake arguments: "--build ./cmake-build-${packageArch} --target ybcon", installation: 'Main'
|
|
|
|
sh "/usr/bin/${path}-strip ./cmake-build-${packageArch}/ybcon"
|
|
|
|
cpack installation: 'Main', workingDir: "cmake-build-${packageArch}"
|
2021-08-15 16:17:10 +02:00
|
|
|
}
|
|
|
|
|
2021-03-24 16:39:43 +01:00
|
|
|
pipeline { // Multi-branch pipeline script for Yerbacon.
|
2020-12-11 22:36:10 +01:00
|
|
|
agent any
|
|
|
|
|
|
|
|
options {
|
2021-03-24 16:58:48 +01:00
|
|
|
buildDiscarder(logRotator(numToKeepStr: '48', artifactNumToKeepStr: '96'))
|
|
|
|
timeout(time: 8, unit: 'MINUTES')
|
2021-02-21 16:45:14 +01:00
|
|
|
sidebarLinks([
|
2021-02-21 17:07:38 +01:00
|
|
|
[displayName: 'Gitea Repository', iconFileName: '/userContent/Yerbacon.png', urlName: 'https://gits.username404.fr/Username404-59/Yerbacon/src/branch/' + env.BRANCH_NAME]
|
2021-02-21 16:45:14 +01:00
|
|
|
])
|
2020-12-11 22:36:10 +01:00
|
|
|
}
|
|
|
|
triggers {
|
|
|
|
pollSCM('*/10 * * * *')
|
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
2021-03-24 16:39:43 +01:00
|
|
|
echo "Building the ${env.BRANCH_NAME} branch.."
|
2021-08-17 17:31:35 +02:00
|
|
|
buildTarget('x86_64-linux-gnu', 'x86_64', 'amd64')
|
2021-08-17 17:48:16 +02:00
|
|
|
buildTarget('i686-linux-gnu', 'i386', 'i386')
|
2021-08-15 16:13:24 +02:00
|
|
|
buildTarget('arm-linux-gnueabi', 'armv4l', 'armel')
|
2021-08-15 17:19:37 +02:00
|
|
|
buildTarget('arm-linux-gnueabihf', 'armv7hl', 'armhf')
|
2021-08-15 21:19:05 +02:00
|
|
|
buildTarget('aarch64-linux-gnu', 'aarch64', 'arm64', false)
|
2021-08-09 18:02:05 +02:00
|
|
|
}
|
|
|
|
}
|
2021-08-09 20:55:43 +02:00
|
|
|
stage('Build for other platforms') {
|
2021-08-09 18:02:05 +02:00
|
|
|
steps {
|
|
|
|
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
2021-08-09 18:04:13 +02:00
|
|
|
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'
|
2021-08-09 18:02:05 +02:00
|
|
|
cpack installation: 'Main', workingDir: 'cmake-build-release-win32'
|
|
|
|
dir('cmake-build-release-win32') { archiveArtifacts artifacts:'*.exe', fingerprint: false }
|
|
|
|
}
|
2020-12-11 22:36:10 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Deploy') {
|
|
|
|
steps {
|
|
|
|
echo 'Deploying....'
|
2021-08-15 16:13:24 +02:00
|
|
|
archiveArtifacts artifacts: 'cmake-build-*/*.deb, cmake-build-*/*.rpm, cmake-build-*/*.tar.gz, cmake-build-*/*.sh', fingerprint: false
|
2020-12-11 22:36:10 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|