49 lines
2.6 KiB
Groovy
49 lines
2.6 KiB
Groovy
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
|
|
|
|
options {
|
|
buildDiscarder(logRotator(numToKeepStr: '48', artifactNumToKeepStr: '96'))
|
|
timeout(time: 8, unit: 'MINUTES')
|
|
sidebarLinks([
|
|
[displayName: 'Gitea Repository', iconFileName: '/userContent/Yerbacon.png', urlName: 'https://gits.username404.fr/Username404-59/Yerbacon/src/branch/' + env.BRANCH_NAME]
|
|
])
|
|
}
|
|
triggers {
|
|
pollSCM('*/10 * * * *')
|
|
}
|
|
stages {
|
|
stage('Build') {
|
|
steps {
|
|
echo "Building the ${env.BRANCH_NAME} branch.."
|
|
cmakeBuild buildDir: 'cmake-build-release', buildType: 'release', cleanBuild: true, installation: 'Main'
|
|
cmake arguments: '--build ./cmake-build-release --target ybcon', installation: 'Main'
|
|
sh 'strip ./cmake-build-release/ybcon'
|
|
cpack installation: 'Main', workingDir: 'cmake-build-release'
|
|
buildTarget('arm-linux-gnueabi', 'armv4l', 'armel')
|
|
}
|
|
}
|
|
stage('Build for other platforms') {
|
|
steps {
|
|
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
|
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'
|
|
cpack installation: 'Main', workingDir: 'cmake-build-release-win32'
|
|
dir('cmake-build-release-win32') { archiveArtifacts artifacts:'*.exe', fingerprint: false }
|
|
}
|
|
}
|
|
}
|
|
stage('Deploy') {
|
|
steps {
|
|
echo 'Deploying....'
|
|
archiveArtifacts artifacts: 'cmake-build-*/*.deb, cmake-build-*/*.rpm, cmake-build-*/*.tar.gz, cmake-build-*/*.sh', fingerprint: false
|
|
}
|
|
}
|
|
}
|
|
} |