Server-Root/Jenkinsfile

210 lines
4.9 KiB
Plaintext
Raw Normal View History

2018-08-08 15:53:18 -04:00
pipeline {
2018-08-09 15:57:58 -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')
2018-11-24 10:26:52 -05:00
choice(choices: ['all', 'x86_debug', 'x64_debug', 'x64_release'], 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'
}
2018-08-09 15:57:58 -04:00
2018-11-01 11:42:47 -04:00
stages {
stage ('build') {
parallel {
2018-11-24 10:34:24 -05:00
stage ('build::x86::debug') {
2018-11-01 11:42:47 -04:00
agent {
label 'linux && x84 && teaspeak'
2018-08-09 15:57:58 -04:00
}
2018-11-24 10:26:52 -05:00
when {
expression { params.target == "" || params.target == "all" || params.target == "x86_debug" }
}
2018-08-09 15:57:58 -04:00
2018-11-01 11:42:47 -04:00
stages {
2018-11-24 10:34:24 -05:00
stage ('build::x86::debug::libraries') {
2018-11-01 12:00:46 -04:00
stages {
2018-11-24 10:34:24 -05:00
stage ('build::x86::debug::libraries::update') {
2018-11-01 12:00:46 -04:00
steps {
sh 'git reset --hard origin/master; git submodule update --init --remote --recursive --force'
sh 'git submodule update --merge'
sh './attach_modules.sh'
}
}
2018-11-24 10:34:24 -05:00
stage ('build::x86::debug::libraries::build') {
2018-11-01 12:00:46 -04:00
when {
expression { params.build_libraries }
}
2019-01-22 15:07:36 -05:00
environment {
CMAKE_BUILD_TYPE="Debug"
}
2018-11-01 12:00:46 -04:00
steps {
sh 'cd libraries; ./build.sh'
}
}
2018-11-01 11:42:47 -04:00
}
}
2018-11-24 10:34:24 -05:00
stage ('build::x86::debug') {
2018-11-01 11:42:47 -04:00
environment {
TEASPEAK_BUILD_TYPE="Debug"
}
2019-01-22 15:07:36 -05:00
environment {
CMAKE_BUILD_TYPE="Debug"
}
2018-11-01 11:42:47 -04:00
stages {
2018-11-24 10:34:24 -05:00
stage ('build::x86::debug::build') {
2018-11-01 11:42:47 -04:00
steps {
sh './build_teaspeak.sh'
}
}
2018-11-24 10:34:24 -05:00
stage ('build::x86::debug::deploy') {
2018-11-01 11:42:47 -04:00
when {
expression { params.deploy_build }
}
steps {
sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/x86'
}
}
}
}
2018-11-01 11:42:08 -04:00
}
}
2018-08-09 15:57:58 -04:00
2018-11-24 10:34:24 -05:00
stage ('build::amd64::debug') {
2018-11-01 11:42:47 -04:00
agent {
label 'linux && amd64 && teaspeak'
2018-08-09 15:57:58 -04:00
}
2018-11-24 10:26:52 -05:00
when {
expression { params.target == "" || params.target == "all" || params.target == "x64_debug" }
}
2018-08-09 15:57:58 -04:00
stages {
2018-11-24 10:34:24 -05:00
stage ('build::amd64::debug::libraries') {
2018-11-01 12:00:46 -04:00
stages {
2018-11-24 10:34:24 -05:00
stage ('build::amd64::debug::libraries::update') {
2018-11-01 12:00:46 -04:00
steps {
sh 'git reset --hard origin/master; git submodule update --init --remote --recursive --force'
sh 'git submodule update --merge'
sh './attach_modules.sh'
}
}
2018-11-24 10:34:24 -05:00
stage ('build::amd64::debug::libraries::build') {
2018-11-01 12:00:46 -04:00
when {
expression { params.build_libraries }
}
2019-01-22 15:07:36 -05:00
environment {
CMAKE_BUILD_TYPE="Debug"
}
2018-11-01 12:00:46 -04:00
steps {
sh 'cd libraries; ./build.sh'
}
}
2018-11-01 11:42:47 -04:00
}
}
2018-11-24 10:34:24 -05:00
stage ('build::amd64::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"
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 {
2018-11-01 11:42:47 -04:00
sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/amd64'
2018-08-09 15:57:58 -04:00
}
}
}
}
2018-11-24 10:34:24 -05:00
stage ('build::amd64::release::deploy') {
2018-11-01 11:42:08 -04:00
when {
2018-11-24 10:26:52 -05:00
expression { params.target == "all" || params.target == "x64_release" || params.build_optimized }
2018-08-09 15:57:58 -04:00
}
2018-11-01 11:42:47 -04:00
agent {
label 'linux && amd64 && teaspeak'
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 {
2018-11-24 10:34:24 -05:00
stage ('build::amd64::release::libraries') {
2018-11-01 12:00:46 -04:00
stages {
2018-11-24 10:34:24 -05:00
stage ('build::amd64::release::libraries::update') {
2018-11-01 12:00:46 -04:00
steps {
sh 'git reset --hard origin/master; git submodule update --init --remote --recursive --force'
sh 'git submodule update --merge'
sh './attach_modules.sh'
}
}
2018-11-24 10:34:24 -05:00
stage ('build::amd64::release::libraries::build') {
2018-11-01 12:00:46 -04:00
when {
expression { params.build_libraries }
}
2019-01-22 15:07:36 -05:00
environment {
CMAKE_BUILD_TYPE="RelWithDebInfo"
}
2018-11-01 12:00:46 -04:00
steps {
sh 'cd libraries; ./build.sh'
}
}
2018-11-01 11:42:47 -04:00
}
}
2018-08-09 15:57:58 -04:00
2018-11-24 10:34:24 -05:00
stage ('build::amd64::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"
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 {
sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/amd64_optimized'
}
}
2018-08-09 15:57:58 -04:00
}
}
2018-08-09 15:59:22 -04:00
}
2018-08-09 15:58:53 -04:00
}
}
2018-08-08 15:53:18 -04:00
}