diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..bb57134 --- /dev/null +++ b/Jenkinsfile @@ -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' + } + } + } + } + } + } + } +} + diff --git a/client b/client index c790c8b..4bd823a 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit c790c8bd08ad7e3940d29b83269c821b3c06b721 +Subproject commit 4bd823a5efd2c4cf2d9bdb0f15bb6b46a2a2830a diff --git a/scripts/build_helper.sh b/scripts/build_helper.sh index 1865185..7413516 100644 --- a/scripts/build_helper.sh +++ b/scripts/build_helper.sh @@ -26,6 +26,11 @@ function requires_rebuild() { base_path=$(realpath $1) 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 echo "Force rebuild for $1 is set. Rebuilding!" return 1 diff --git a/shared b/shared index 2f07e0d..0bb0eb5 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit 2f07e0d0447ec44d265d43b2cd85b3db3143a131 +Subproject commit 0bb0eb5df1d9e35a53d7ff050a84fb9c25764403