Add a javascript target to the Jenkinsfile
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
dce232c5c9
commit
7b8f4fc6c4
|
@ -1,10 +1,13 @@
|
||||||
|
String cmake_generator() { return fileExists('/usr/bin/ninja') ? 'Ninja' : 'Unix Makefiles' }
|
||||||
|
String no_compilation_cache_flags() { return '-DNO_CCACHE=ON -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON' }
|
||||||
|
|
||||||
def buildTarget(String path, String rpmArch = 'noarch', String debArch = 'noarch', boolean isPackageArchDeb = true, String suffix = '') {
|
def buildTarget(String path, String rpmArch = 'noarch', String debArch = 'noarch', boolean isPackageArchDeb = true, String suffix = '') {
|
||||||
final String packageArch = isPackageArchDeb ? debArch : rpmArch;
|
final String packageArch = isPackageArchDeb ? debArch : rpmArch;
|
||||||
final String system_name = !path.contains('mingw') ? sh(returnStdout: true, script: 'uname -s').trim() : 'Windows'
|
final String system_name = !path.contains('mingw') ? sh(returnStdout: true, script: 'uname -s').trim() : 'Windows'
|
||||||
// Note: CMake 3.20 or higher is needed
|
// Note: CMake 3.20 or higher is needed
|
||||||
cmakeBuild buildDir: "cmake-build-${packageArch}${suffix}", buildType: 'release', cleanBuild: true, installation: 'Latest',
|
cmakeBuild buildDir: "cmake-build-${packageArch}${suffix}", buildType: 'release', cleanBuild: true, installation: 'Latest',
|
||||||
cmakeArgs: "--no-warn-unused-cli -DCMAKE_SYSTEM_NAME=\"${system_name}\" -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 -DCMAKE_RC_COMPILER=/usr/bin/${path}-windres -DCPACK_RPM_PACKAGE_ARCHITECTURE=${rpmArch} -DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=${debArch} -DCXX_TARGET=${packageArch} -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS=/usr/${path}/lib/ -DNO_CCACHE=ON -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON",
|
cmakeArgs: "--no-warn-unused-cli -DCMAKE_SYSTEM_NAME=\"${system_name}\" -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 -DCMAKE_RC_COMPILER=/usr/bin/${path}-windres -DCPACK_RPM_PACKAGE_ARCHITECTURE=${rpmArch} -DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=${debArch} -DCXX_TARGET=${packageArch} -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS=/usr/${path}/lib/ ${no_compilation_cache_flags()}",
|
||||||
generator: fileExists('/usr/bin/ninja') ? 'Ninja' : 'Unix Makefiles'
|
generator: cmake_generator()
|
||||||
cmake arguments: "--build ./cmake-build-${packageArch}${suffix} --target ybcon", installation: 'Latest'
|
cmake arguments: "--build ./cmake-build-${packageArch}${suffix} --target ybcon", installation: 'Latest'
|
||||||
sh "/usr/bin/${path}-strip -s ./cmake-build-${packageArch}${suffix}/ybcon*"
|
sh "/usr/bin/${path}-strip -s ./cmake-build-${packageArch}${suffix}/ybcon*"
|
||||||
cpack installation: 'Latest', workingDir: "cmake-build-${packageArch}${suffix}"
|
cpack installation: 'Latest', workingDir: "cmake-build-${packageArch}${suffix}"
|
||||||
|
@ -37,6 +40,10 @@ pipeline { // Multi-branch pipeline script for Yerbacon.
|
||||||
echo "Building the ${env.BRANCH_NAME} branch.."
|
echo "Building the ${env.BRANCH_NAME} branch.."
|
||||||
buildTarget('x86_64-linux-gnu', 'x86_64', 'amd64')
|
buildTarget('x86_64-linux-gnu', 'x86_64', 'amd64')
|
||||||
buildTarget('i686-linux-gnu', 'i386', 'i386')
|
buildTarget('i686-linux-gnu', 'i386', 'i386')
|
||||||
|
cmakeBuild buildDir: "cmake-build-release-emscripten", buildType: 'release', cleanBuild: true, installation: 'Latest',
|
||||||
|
cmakeArgs: "-DCMAKE_TOOLCHAIN_FILE=\"/usr/share/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake\" -DCMAKE_EXE_LINKER_FLAGS=\"--closure 1 -sWASM=0 --memory-init-file 0\" ${no_compilation_cache_flags()}",
|
||||||
|
generator: cmake_generator()
|
||||||
|
cmake arguments: "--build ./cmake-build-release-emscripten", installation: 'Latest'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build for other architectures') {
|
stage('Build for other architectures') {
|
||||||
|
@ -64,7 +71,7 @@ pipeline { // Multi-branch pipeline script for Yerbacon.
|
||||||
stage('Deploy') {
|
stage('Deploy') {
|
||||||
steps {
|
steps {
|
||||||
echo 'Deploying....'
|
echo 'Deploying....'
|
||||||
archiveArtifacts artifacts: 'cmake-build-*/*.deb, cmake-build-*/*.rpm, cmake-build-*/*.tar.gz, cmake-build-*/*.sh', fingerprint: false
|
archiveArtifacts artifacts: 'cmake-build-*/*.deb, cmake-build-*/*.rpm, cmake-build-*/*.tar.gz, cmake-build-*/*.sh, cmake-build-release-emscripten/*.js', fingerprint: false
|
||||||
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
||||||
archiveArtifacts artifacts: 'cmake-build-*/*wpkg.*.exe, cmake-build-*/*.zip'
|
archiveArtifacts artifacts: 'cmake-build-*/*wpkg.*.exe, cmake-build-*/*.zip'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue