Server-Root/Jenkinsfile

293 lines
6.5 KiB
Plaintext
Raw Normal View History

2018-08-08 21:53:18 +02:00
pipeline {
2018-08-09 21:57:58 +02:00
agent any
2018-11-01 16:16:06 +01:00
parameters {
2018-11-01 17:11:47 +01:00
booleanParam(defaultValue: false, description: 'Enabled/disables the building of an optimized build', name: 'build_optimized')
2018-11-01 16:22:28 +01:00
booleanParam(defaultValue: true, description: 'Build the libraries as well', name: 'build_libraries')
2018-11-01 16:28:05 +01:00
booleanParam(defaultValue: true, description: 'Deploy this build', name: 'deploy_build')
2019-04-19 14:02:59 +02:00
choice(choices: ['none', 'x86_debug', 'x86_release', 'x86_stable', 'x64_debug', 'x64_release', 'x64_stable'], description: 'Which target do you want to build?', name: 'target')
2018-11-01 16:16:06 +01:00
}
2018-11-01 16:42:08 +01:00
environment {
//General flags
CXX_FLAGS = ''
C_FLAGS = ''
//CMake specific flags
CMAKE_OPTIONS = ''
CMAKE_MAKE_OPTIONS = '-j 12'
//Make specific flags
MAKE_OPTIONS = '-j 12'
2019-04-19 14:02:50 +02:00
JENKINS_BUILD_TARGET="${params.target}"
2018-11-01 16:42:08 +01:00
}
2018-08-09 21:57:58 +02:00
2018-11-01 16:42:47 +01:00
stages {
2019-04-19 13:59:30 +02:00
/* build all amd64 stuff */
stage ('build::x64') {
agent {
label 'linux && amd64 && teaspeak'
}
when {
expression { params.target == "x64_debug" || params.target == "x64_release" || params.target == "x64_stable" }
}
2019-10-13 18:52:17 +02:00
environment {
build_os_type="linux"
build_os_type="x64"
}
2019-04-19 13:59:30 +02:00
2019-04-19 15:47:14 +02:00
stages {
/* first of all we have to update our libraries */
stage ('libraries::update') {
steps {
sh './attach_modules.sh'
}
}
2019-04-19 13:59:30 +02:00
stage ('build::x64::libraries') {
2018-11-24 16:26:52 +01:00
when {
2019-04-19 13:59:30 +02:00
expression { params.build_libraries }
}
environment {
CMAKE_BUILD_TYPE="RelWithDebInfo" /* we build out libraries every time in release mode! (Performance improve) */
2018-11-24 16:26:52 +01:00
}
2018-08-09 21:57:58 +02:00
2019-04-19 13:59:30 +02:00
steps {
sh 'cd libraries; ./build.sh'
}
}
stage ('build::x64::debug') {
when {
expression { params.target == "x64_debug" }
}
2018-11-01 16:42:47 +01:00
stages {
2019-04-19 13:59:30 +02:00
stage ('build::x64::debug::build') {
environment {
TEASPEAK_BUILD_TYPE="Debug"
CMAKE_BUILD_TYPE="Debug"
2019-04-19 14:20:13 +02:00
TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=1 -DBUILD_TYPE_NAME='beta'"
2019-04-19 13:59:30 +02:00
}
steps {
sh './build_teaspeak.sh'
2018-11-01 16:42:47 +01:00
}
}
2019-04-19 13:59:30 +02:00
stage ('build::amd64::debug::deploy') {
when {
expression { params.deploy_build }
}
2018-11-01 16:42:47 +01:00
2019-04-19 13:59:30 +02:00
steps {
2019-04-19 14:07:20 +02:00
sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/amd64_debug'
2019-04-19 13:59:30 +02:00
}
}
}
}
stage ('build::x64::release') {
when {
expression { params.target == "x64_release" }
}
stages {
stage ('build::x64::release::build') {
2018-11-01 16:42:47 +01:00
environment {
2019-04-19 13:59:30 +02:00
TEASPEAK_BUILD_TYPE="Release"
CMAKE_BUILD_TYPE="RelWithDebInfo"
2019-04-19 14:20:13 +02:00
TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=1 -DBUILD_TYPE_NAME='beta'"
2019-01-22 21:07:36 +01:00
}
2018-11-01 16:42:47 +01:00
2019-04-19 13:59:30 +02:00
steps {
sh './build_teaspeak.sh'
}
}
stage ('build::amd64::release::deploy') {
when {
expression { params.deploy_build }
}
steps {
sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/amd64_optimized'
2018-11-01 16:42:47 +01:00
}
}
2018-11-01 16:42:08 +01:00
}
}
2019-04-19 14:07:20 +02:00
stage ('build::x64::stable') {
when {
expression { params.target == "x64_stable" }
}
stages {
stage ('build::x64::stable::build') {
environment {
TEASPEAK_BUILD_TYPE="Release"
CMAKE_BUILD_TYPE="RelWithDebInfo"
2019-04-19 14:20:13 +02:00
2019-04-19 14:27:25 +02:00
TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=0 -DBUILD_TYPE_NAME=''"
2019-04-19 14:07:20 +02:00
}
steps {
sh './build_teaspeak.sh'
}
}
stage ('build::amd64::stable::deploy') {
when {
expression { params.deploy_build }
}
steps {
sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/amd64_stable'
}
}
}
}
2019-04-19 13:59:30 +02:00
}
}
/* build all x86 stuff */
stage ('build::x86') {
agent {
label 'linux && x86 && teaspeak'
}
when {
expression { params.target == "x86_debug" || params.target == "x86_release" || params.target == "x86_stable" }
}
2019-10-13 18:52:17 +02:00
environment {
build_os_type="linux"
build_os_type="x86"
}
2019-04-19 13:59:30 +02:00
stages {
2019-04-19 15:47:14 +02:00
/* first of all we have to update our libraries */
stage ('libraries::update') {
steps {
sh './attach_modules.sh'
}
}
2019-04-19 13:59:30 +02:00
stage ('build::x86::libraries') {
when {
expression { params.build_libraries }
}
environment {
CMAKE_BUILD_TYPE="RelWithDebInfo" /* we build out libraries every time in release mode! (Performance improve) */
2019-05-27 20:21:59 +02:00
BUILD_ARCH_TARGET="x86"
2019-04-19 13:59:30 +02:00
}
2018-08-09 21:57:58 +02:00
2019-04-19 13:59:30 +02:00
steps {
sh 'cd libraries; ./build.sh'
2018-08-09 21:57:58 +02:00
}
2019-04-19 13:59:30 +02:00
}
stage ('build::x86::debug') {
2018-11-24 16:26:52 +01:00
when {
2019-04-19 13:59:30 +02:00
expression { params.target == "x86_debug" }
2018-11-24 16:26:52 +01:00
}
2019-04-19 13:59:30 +02:00
2018-08-09 21:57:58 +02:00
stages {
2019-04-19 13:59:30 +02:00
stage ('build::x86::debug::build') {
2018-11-01 16:42:47 +01:00
environment {
TEASPEAK_BUILD_TYPE="Debug"
2019-01-22 21:13:01 +01:00
CMAKE_BUILD_TYPE="Debug"
2019-04-19 14:20:13 +02:00
TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=1 -DBUILD_TYPE_NAME='beta'"
2018-11-01 16:42:47 +01:00
}
2018-08-09 21:57:58 +02:00
steps {
2018-11-01 16:42:08 +01:00
sh './build_teaspeak.sh'
2018-08-09 21:57:58 +02:00
}
}
2018-11-01 16:42:47 +01:00
2018-11-24 16:34:24 +01:00
stage ('build::amd64::debug::deploy') {
2018-11-01 16:42:08 +01:00
when {
expression { params.deploy_build }
2018-11-01 16:16:06 +01:00
}
2018-11-01 16:42:47 +01:00
2018-11-01 16:42:08 +01:00
steps {
2019-04-19 14:07:20 +02:00
sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/x86_debug'
2018-08-09 21:57:58 +02:00
}
}
}
}
2019-04-19 13:59:30 +02:00
stage ('build::x86::release') {
2018-11-01 16:42:08 +01:00
when {
2019-04-19 13:59:30 +02:00
expression { params.target == "x86_release" }
2018-11-01 16:42:08 +01:00
}
2019-04-19 13:59:30 +02:00
2018-11-01 16:42:47 +01:00
stages {
2019-04-19 13:59:30 +02:00
stage ('build::x86::release::build') {
2018-11-01 16:42:47 +01:00
environment {
TEASPEAK_BUILD_TYPE="Release"
2019-01-22 21:07:36 +01:00
CMAKE_BUILD_TYPE="RelWithDebInfo"
2019-04-19 14:20:13 +02:00
TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=1 -DBUILD_TYPE_NAME='beta'"
2018-11-01 16:42:47 +01:00
}
2018-11-01 16:42:08 +01:00
2018-11-01 16:42:47 +01:00
steps {
sh './build_teaspeak.sh'
}
}
2018-11-01 16:42:08 +01:00
2018-11-24 16:34:24 +01:00
stage ('build::amd64::release::deploy') {
2018-11-01 16:42:47 +01:00
when {
expression { params.deploy_build }
}
2018-11-01 16:42:08 +01:00
2018-11-01 16:42:47 +01:00
steps {
2019-04-19 14:07:20 +02:00
sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/x86_optimized'
2018-11-01 16:42:47 +01:00
}
}
2018-08-09 21:57:58 +02:00
}
}
2019-06-20 13:10:41 +02:00
stage ('build::x64::stable') {
when {
expression { params.target == "x86_stable" }
}
stages {
stage ('build::x86::stable::build') {
environment {
TEASPEAK_BUILD_TYPE="Release"
CMAKE_BUILD_TYPE="RelWithDebInfo"
TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=0 -DBUILD_TYPE_NAME=''"
}
steps {
sh './build_teaspeak.sh'
}
}
stage ('build::amd64::stable::deploy') {
when {
expression { params.deploy_build }
}
steps {
sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/x86_stable'
}
}
}
}
2018-08-09 21:59:22 +02:00
}
2018-08-09 21:58:53 +02:00
}
}
2018-08-08 21:53:18 +02:00
}