Server-Root/Jenkinsfile

293 lines
6.5 KiB
Plaintext
Raw Normal View History

2018-08-08 15:53:18 -04:00
pipeline {
2019-10-13 13:35:01 -04:00
agent any
2018-11-01 11:16:06 -04:00
parameters {
2018-11-01 12:11:47 -04:00
booleanParam(defaultValue: false, description: 'Enabled/disables the building of an optimized build', name: 'build_optimized')
2018-11-01 11:22:28 -04:00
booleanParam(defaultValue: true, description: 'Build the libraries as well', name: 'build_libraries')
2018-11-01 11:28:05 -04:00
booleanParam(defaultValue: true, description: 'Deploy this build', name: 'deploy_build')
2019-04-19 08:02:59 -04: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 11:16:06 -04:00
}
2018-11-01 11:42:08 -04: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 08:02:50 -04:00
JENKINS_BUILD_TARGET="${params.target}"
2018-11-01 11:42:08 -04:00
}
2018-08-09 15:57:58 -04:00
2018-11-01 11:42:47 -04:00
stages {
2019-04-19 07:59:30 -04: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 12:52:17 -04:00
environment {
build_os_type="linux"
build_os_type="x64"
}
2019-04-19 07:59:30 -04:00
2019-04-19 09:47:14 -04:00
stages {
/* first of all we have to update our libraries */
stage ('libraries::update') {
steps {
sh './attach_modules.sh'
}
}
2019-04-19 07:59:30 -04:00
stage ('build::x64::libraries') {
2018-11-24 10:26:52 -05:00
when {
2019-04-19 07:59:30 -04:00
expression { params.build_libraries }
}
environment {
CMAKE_BUILD_TYPE="RelWithDebInfo" /* we build out libraries every time in release mode! (Performance improve) */
2018-11-24 10:26:52 -05:00
}
2018-08-09 15:57:58 -04:00
2019-04-19 07:59:30 -04:00
steps {
sh 'cd libraries; ./build.sh'
}
}
stage ('build::x64::debug') {
when {
expression { params.target == "x64_debug" }
}
2018-11-01 11:42:47 -04:00
stages {
2019-04-19 07:59:30 -04:00
stage ('build::x64::debug::build') {
environment {
TEASPEAK_BUILD_TYPE="Debug"
CMAKE_BUILD_TYPE="Debug"
2019-04-19 08:20:13 -04:00
TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=1 -DBUILD_TYPE_NAME='beta'"
2019-04-19 07:59:30 -04:00
}
steps {
sh './build_teaspeak.sh'
2018-11-01 11:42:47 -04:00
}
}
2019-04-19 07:59:30 -04:00
stage ('build::amd64::debug::deploy') {
when {
expression { params.deploy_build }
}
2018-11-01 11:42:47 -04:00
2019-04-19 07:59:30 -04:00
steps {
2019-04-19 08:07:20 -04:00
sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/amd64_debug'
2019-04-19 07:59:30 -04:00
}
}
}
}
stage ('build::x64::release') {
when {
expression { params.target == "x64_release" }
}
stages {
stage ('build::x64::release::build') {
2018-11-01 11:42:47 -04:00
environment {
2019-04-19 07:59:30 -04:00
TEASPEAK_BUILD_TYPE="Release"
CMAKE_BUILD_TYPE="RelWithDebInfo"
2019-04-19 08:20:13 -04:00
TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=1 -DBUILD_TYPE_NAME='beta'"
2019-01-22 15:07:36 -05:00
}
2018-11-01 11:42:47 -04:00
2019-04-19 07:59:30 -04: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 11:42:47 -04:00
}
}
2018-11-01 11:42:08 -04:00
}
}
2019-04-19 08:07:20 -04: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 08:20:13 -04:00
2019-04-19 08:27:25 -04:00
TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=0 -DBUILD_TYPE_NAME=''"
2019-04-19 08:07:20 -04: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 07:59:30 -04: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 12:52:17 -04:00
environment {
build_os_type="linux"
build_os_type="x86"
}
2019-04-19 07:59:30 -04:00
stages {
2019-04-19 09:47:14 -04:00
/* first of all we have to update our libraries */
stage ('libraries::update') {
steps {
sh './attach_modules.sh'
}
}
2019-04-19 07:59:30 -04: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 14:21:59 -04:00
BUILD_ARCH_TARGET="x86"
2019-04-19 07:59:30 -04:00
}
2018-08-09 15:57:58 -04:00
2019-04-19 07:59:30 -04:00
steps {
sh 'cd libraries; ./build.sh'
2018-08-09 15:57:58 -04:00
}
2019-04-19 07:59:30 -04:00
}
stage ('build::x86::debug') {
2018-11-24 10:26:52 -05:00
when {
2019-04-19 07:59:30 -04:00
expression { params.target == "x86_debug" }
2018-11-24 10:26:52 -05:00
}
2019-04-19 07:59:30 -04:00
2018-08-09 15:57:58 -04:00
stages {
2019-04-19 07:59:30 -04:00
stage ('build::x86::debug::build') {
2018-11-01 11:42:47 -04:00
environment {
TEASPEAK_BUILD_TYPE="Debug"
2019-01-22 15:13:01 -05:00
CMAKE_BUILD_TYPE="Debug"
2019-04-19 08:20:13 -04:00
TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=1 -DBUILD_TYPE_NAME='beta'"
2018-11-01 11:42:47 -04:00
}
2018-08-09 15:57:58 -04:00
steps {
2018-11-01 11:42:08 -04:00
sh './build_teaspeak.sh'
2018-08-09 15:57:58 -04:00
}
}
2018-11-01 11:42:47 -04:00
2018-11-24 10:34:24 -05:00
stage ('build::amd64::debug::deploy') {
2018-11-01 11:42:08 -04:00
when {
expression { params.deploy_build }
2018-11-01 11:16:06 -04:00
}
2018-11-01 11:42:47 -04:00
2018-11-01 11:42:08 -04:00
steps {
2019-04-19 08:07:20 -04:00
sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/x86_debug'
2018-08-09 15:57:58 -04:00
}
}
}
}
2019-04-19 07:59:30 -04:00
stage ('build::x86::release') {
2018-11-01 11:42:08 -04:00
when {
2019-04-19 07:59:30 -04:00
expression { params.target == "x86_release" }
2018-11-01 11:42:08 -04:00
}
2019-04-19 07:59:30 -04:00
2018-11-01 11:42:47 -04:00
stages {
2019-04-19 07:59:30 -04:00
stage ('build::x86::release::build') {
2018-11-01 11:42:47 -04:00
environment {
TEASPEAK_BUILD_TYPE="Release"
2019-01-22 15:07:36 -05:00
CMAKE_BUILD_TYPE="RelWithDebInfo"
2019-04-19 08:20:13 -04:00
TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=1 -DBUILD_TYPE_NAME='beta'"
2018-11-01 11:42:47 -04:00
}
2018-11-01 11:42:08 -04:00
2018-11-01 11:42:47 -04:00
steps {
sh './build_teaspeak.sh'
}
}
2018-11-01 11:42:08 -04:00
2018-11-24 10:34:24 -05:00
stage ('build::amd64::release::deploy') {
2018-11-01 11:42:47 -04:00
when {
expression { params.deploy_build }
}
2018-11-01 11:42:08 -04:00
2018-11-01 11:42:47 -04:00
steps {
2019-04-19 08:07:20 -04:00
sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/x86_optimized'
2018-11-01 11:42:47 -04:00
}
}
2018-08-09 15:57:58 -04:00
}
}
2019-06-20 07:10:41 -04: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 15:59:22 -04:00
}
2018-08-09 15:58:53 -04:00
}
}
2018-08-08 15:53:18 -04:00
}