forked from The-Cataclysm-Preservation-Project/TrinityCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
66 lines (59 loc) · 3.09 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
pipeline {
parameters {
string(name: 'BUILD_THREADS', defaultValue: '', description: 'Build threads')
string(name: 'WITH_DYNAMIC_LINKING', defaultValue: '0', description: 'Build Option WITH_DYNAMIC_LINKING')
string(name: 'SCRIPTS', defaultValue: 'static', description: 'Build Option SCRIPTS')
string(name: 'BNETSERVER', defaultValue: '1', description: 'Build Option BNETSERVER')
string(name: 'WORLDSERVER', defaultValue: '1', description: 'Build Option WORLDSERVER')
string(name: 'TOOLS', defaultValue: '0', description: 'Build Option TOOLS')
string(name: 'WITH_WARNINGS', defaultValue: '1', description: 'Build Option WITH_WARNINGS')
string(name: 'USE_COREPCH', defaultValue: '1', description: 'Build Option USE_COREPCH')
string(name: 'USE_SCRIPTPCH', defaultValue: '1', description: 'Build Option USE_SCRIPTPCH')
string(name: 'WITH_COREDEBUG', defaultValue: '0', description: 'Build Option WITH_COREDEBUG')
string(name: 'CMAKE_BUILD_TYPE', defaultValue: 'RelWithDebInfo', description: 'Build Option CMAKE_BUILD_TYPE')
string(name: 'CMAKE_ADDITIONAL', defaultValue: '', description: 'Additional CMake parameters')
}
agent {
node {
label ''
customWorkspace "/srv/jenkins/${JOB_NAME}"
}
}
options {
buildDiscarder(logRotator(daysToKeepStr: '30'))
checkoutToSubdirectory('git')
disableConcurrentBuilds()
timestamps()
}
stages {
stage('Build') {
steps {
echo 'Building...'
dir('build') {
sh "cmake ../git -DCMAKE_INSTALL_PREFIX=../ -DWITH_DYNAMIC_LINKING=${params.WITH_DYNAMIC_LINKING} -DSCRIPTS=${params.SCRIPTS} -DBNETSERVER=${params.BNETSERVER} -DWORLDSERVER=${params.WORLDSERVER} -DTOOLS=${params.TOOLS} -DWITH_WARNINGS=${params.WITH_WARNINGS} -DUSE_COREPCH=${params.USE_COREPCH} -DUSE_SCRIPTPCH=${params.USE_SCRIPTPCH} -DWITH_COREDEBUG=${params.WITH_COREDEBUG} -DCMAKE_BUILD_TYPE=${params.CMAKE_BUILD_TYPE} -DBoost_NO_BOOST_CMAKE=ON ${params.CMAKE_ADDITIONAL}"
sh """
set +x
THREADS="${GLOBAL_BUILD_THREADS}"
if [ ! -z "${params.BUILD_THREADS}" ]; then
THREADS="${params.BUILD_THREADS}"
fi
echo "Build started with \${THREADS} threads."
make -j\${THREADS} -k
"""
}
}
}
stage('Deploy') {
steps {
echo 'Deploying...'
dir('build') {
sh 'make install'
}
dir('bin') {
sh './bnetserver --version'
sh './worldserver --version'
}
}
}
}
}