Added jenkinsfile

This commit is contained in:
WolverinDEV 2019-07-06 17:00:36 +02:00
parent 33644f2f8f
commit e7df966ca4
4 changed files with 103 additions and 2 deletions

96
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,96 @@
pipeline {
agent any
parameters {
booleanParam(defaultValue: true, description: 'Deploy this build', name: 'deploy_build')
choice(choices: ['none', ''win32', 'linux'], description: 'Which os do you want to build?', name: 'os_type')
choice(choices: ['amd64'], description: 'Which target do you want to build?', name: 'os_arch')
choice(choices: ['release'], description: 'Target build channel', name: 'channel')
text(name: 'force_rebuild', defaultValue: '', description: 'Force rebuild libraries (Separate with a ";" | * = everything)')
}
environment {
//General flags
CXX_FLAGS = ''
C_FLAGS = ''
//CMake specific flags
CMAKE_OPTIONS = ''
CMAKE_MAKE_OPTIONS = '-j 12'
//Make specific flags
MAKE_OPTIONS = '-j 12'
force_rebuild="${params.force_rebuild}"
build_os_type="${params.os_type}"
build_os_arch="${params.os_arch}"
teaclient_deploy_channel = "${params.deploy_build ? ${params.channel} : ${params.channel}}"
}
stages {
stage ('build::linux') {
when {
expression { params.os_type == "linux" }
}
stages {
stage ('build::linux::amd64') {
agent {
label 'linux && amd64 && teaspeak-client'
}
when {
expression { params.os_arch == "amd64" }
}
environment {
CMAKE_BUILD_TYPE="RelWithDebInfo" /* we build out libraries every time in release mode! (Performance improve) */
}
stages {
stage('build::linux::amd64::libraries') {
steps {
sh 'git submodule update --init --recursive -f'
sh 'git submodule foreach git reset --hard'
sh './third_party/build.sh'
sh './build_shared.sh'
}
}
stage('build::linux::amd64::build') {
steps {
echo "Deploy channel (empty on no deploy): ${teaclient_deploy_channel}"
sh './build_client.sh'
}
}
}
}
}
}
stage ('build::win32') {
when {
expression { params.os_type == "win32" }
}
stages {
stage ('build::win32::amd64') {
agent {
label 'win32 && amd64 && teaspeak-client'
}
when {
expression { params.os_arch == "amd64" }
}
stages {
stage('build::win32::amd64::libraries') {
steps {
sh 'git submodule update --init --recursive -f'
sh 'git submodule foreach git reset --hard'
}
}
}
}
}
}
}
}

2
client

@ -1 +1 @@
Subproject commit c790c8bd08ad7e3940d29b83269c821b3c06b721 Subproject commit 4bd823a5efd2c4cf2d9bdb0f15bb6b46a2a2830a

View File

@ -26,6 +26,11 @@ function requires_rebuild() {
base_path=$(realpath $1) base_path=$(realpath $1)
echo "Testing library build status at $1 ($base_path)" echo "Testing library build status at $1 ($base_path)"
if [[ "$force_rebuild" == "*" ]]; then
echo "Force rebuild for everything. Rebuilding!"
return 1
fi
if echo "$force_rebuild" | grep -q -E "(^|;)$1(;|$)"; then if echo "$force_rebuild" | grep -q -E "(^|;)$1(;|$)"; then
echo "Force rebuild for $1 is set. Rebuilding!" echo "Force rebuild for $1 is set. Rebuilding!"
return 1 return 1

2
shared

@ -1 +1 @@
Subproject commit 2f07e0d0447ec44d265d43b2cd85b3db3143a131 Subproject commit 0bb0eb5df1d9e35a53d7ff050a84fb9c25764403