| 
									
										
										
										
											2019-07-06 17:00:36 +02:00
										 |  |  | pipeline { | 
					
						
							|  |  |  | 	agent any | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     parameters { | 
					
						
							|  |  |  |        booleanParam(defaultValue: true, description: 'Deploy this build', name: 'deploy_build') | 
					
						
							| 
									
										
										
										
											2019-07-06 17:07:43 +02:00
										 |  |  |        choice(choices: ['none', 'win32', 'linux'], description: 'Which os do you want to build?', name: 'os_type') | 
					
						
							| 
									
										
										
										
											2019-07-06 17:00:36 +02:00
										 |  |  |        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 = '' | 
					
						
							| 
									
										
										
										
											2019-07-06 18:18:48 +02:00
										 |  |  | 		CMAKE_MAKE_OPTIONS = '-j12' | 
					
						
							| 
									
										
										
										
											2019-07-06 17:00:36 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		//Make specific flags | 
					
						
							| 
									
										
										
										
											2019-07-06 18:18:48 +02:00
										 |  |  | 		MAKE_OPTIONS = '-j12' | 
					
						
							| 
									
										
										
										
											2019-07-06 17:00:36 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		force_rebuild="${params.force_rebuild}" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		build_os_type="${params.os_type}" | 
					
						
							|  |  |  | 		build_os_arch="${params.os_arch}" | 
					
						
							| 
									
										
										
										
											2019-07-06 17:11:27 +02:00
										 |  |  |         teaclient_deploy_channel = "${params.deploy_build ? "${params.channel}" : ""}" | 
					
						
							| 
									
										
										
										
											2019-07-06 17:00:36 +02:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	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}" | 
					
						
							| 
									
										
										
										
											2019-07-06 17:25:38 +02:00
										 |  |  |                                 withCredentials([string(credentialsId: 'teaclient_deploy_secret', variable: 'teaclient_deploy_secret')]) { | 
					
						
							|  |  |  |                                     sh './build_client.sh' | 
					
						
							|  |  |  |                                 } | 
					
						
							| 
									
										
										
										
											2019-07-06 17:00:36 +02:00
										 |  |  |                             } | 
					
						
							|  |  |  |                         } | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		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' | 
					
						
							|  |  |  |                             } | 
					
						
							|  |  |  |                         } | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 |