forked from liblogicalaccess/liblogicalaccess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
164 lines (152 loc) · 5.9 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
@Library("islog-helper") _
pipeline {
agent none
options {
gitLabConnection('Gitlab Pontos')
disableConcurrentBuilds()
lock label: 'CONAN_CONFIGURATION_LOCK', quantity: 1
}
environment {
LINUX_DOCKER_IMAGE_NAME = 'docker-registry.islog.com:5000/conan-recipes-support:latest'
ANDROID_DOCKER_IMAGE_NAME = 'docker-registry.islog.com:5000/conan-recipes-support-android:latest'
PACKAGE_NAME = "LogicalAccess/2.2.1@islog/${BRANCH_NAME}"
// This is needed because MSBuild fails spuriously quiet often
// on the build machine.
MSBUILDDISABLENODEREUSE = 1
// Enable recipe/package revision support for Conan.
CONAN_REVISIONS_ENABLED = 1
}
parameters {
booleanParam(name: 'BUILD_DEBUG',
defaultValue: true,
description: 'Perform DEBUG build')
booleanParam(name: 'BUILD_RELEASE',
defaultValue: true,
description: 'Perform RELEASE build')
booleanParam(name: 'BUILD_WINDOWS',
defaultValue: true,
description: 'Perform Windows build')
booleanParam(name: 'BUILD_LINUX',
defaultValue: true,
description: 'Perform Linux build')
booleanParam(name: 'BUILD_ANDROID',
defaultValue: true,
description: 'Perform Android build')
string(name: 'BUILD_SINGLE_PROFILE',
defaultValue: '',
description: 'If not empty, will only build LLA for the specified profile.' +
' This takes precedence over other parameters.')
}
stages {
stage('Android') {
when {
beforeAgent true
expression { params.BUILD_ANDROID && params.BUILD_SINGLE_PROFILE == '' }
}
steps {
script {
lla.startJobForProfiles(['lla/arm_clang_android_21_debug',
'lla/arm_clang_android_21',
'lla/x86_clang_android_21',
'lla/x64_clang_android_21',
'lla/arm64_clang_android_21'
])
}
}
}
stage('Minimal Feature Build') {
when {
beforeAgent true
expression { params.BUILD_SINGLE_PROFILE == '' }
}
steps {
script {
lst = []
if (params.BUILD_WINDOWS) {
if (params.BUILD_DEBUG) {
lst += 'lla/x64_msvc_debug_min'
lst += 'lla/x86_msvc_debug_min'
}
if (params.BUILD_RELEASE) {
lst += 'lla/x64_msvc_release_min'
lst += 'lla/x86_msvc_release_min'
}
}
if (params.BUILD_LINUX) {
if (params.BUILD_DEBUG) {
lst += 'lla/x64_gcc6_debug_min'
}
if (params.BUILD_RELEASE) {
lst += 'lla/x64_gcc6_release_min'
}
}
lla.startJobForProfiles(lst)
}
}
}
stage('Complete Feature Build') {
when {
beforeAgent true
expression { params.BUILD_SINGLE_PROFILE == '' }
}
steps {
script {
lst = []
if (params.BUILD_WINDOWS) {
if (params.BUILD_DEBUG) {
lst += 'lla/x64_msvc_debug_full'
lst += 'lla/x86_msvc_debug_full'
}
if (params.BUILD_RELEASE) {
lst += 'lla/x64_msvc_release_full'
lst += 'lla/x86_msvc_release_full'
}
}
if (params.BUILD_LINUX) {
if (params.BUILD_DEBUG) {
lst += 'lla/x64_gcc6_debug_full'
}
if (params.BUILD_RELEASE) {
lst += 'lla/x64_gcc6_release_full'
}
}
lla.startJobForProfiles(lst)
}
}
}
stage('Single profile') {
when {
beforeAgent true
expression { params.BUILD_SINGLE_PROFILE != '' }
}
steps {
script {
lla.startJobForProfiles([params.BUILD_SINGLE_PROFILE])
}
}
}
}
post {
changed {
script {
if (currentBuild.currentResult == 'FAILURE' || currentBuild.currentResult == 'SUCCESS') {
// Other values: SUCCESS, UNSTABLE
// Send an email only if the build status has changed from green/unstable to red
emailext subject: '$DEFAULT_SUBJECT',
body: '$DEFAULT_CONTENT',
recipientProviders: [
[$class: 'CulpritsRecipientProvider'],
[$class: 'DevelopersRecipientProvider'],
[$class: 'RequesterRecipientProvider']
],
replyTo: '[email protected]',
to: '[email protected]'
}
}
}
}
}
def debPackageBuild() {
sh './scripts/debian/git-buildpackage.sh'
sh 'cd /home/jenkins/liblogicalaccess-debian && dupload --nomail ../*.changes'
}