2021-08-15 16:24:27 +02:00
|
|
|
def buildTarget(path, 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}"
|
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.."
|
2020-12-11 22:36:10 +01:00
|
|
|
cmakeBuild buildDir: 'cmake-build-release', buildType: 'release', cleanBuild: true, installation: 'Main'
|
2021-08-10 11:00:08 +02:00
|
|
|
cmake arguments: '--build ./cmake-build-release --target ybcon', installation: 'Main'
|
2021-08-09 18:29:13 +02:00
|
|
|
sh 'strip ./cmake-build-release/ybcon'
|
2021-08-15 16:13:24 +02:00
|
|
|
cpack installation: 'Main', workingDir: 'cmake-build-release'
|
|
|
|
buildTarget('arm-linux-gnueabi', 'armv4l', 'armel')
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|