-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
232 lines (209 loc) · 8.88 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
pipeline {
agent none
options {
ansiColor('xterm')
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')
timeout(time: 1, unit: 'HOURS')
timestamps()
disableConcurrentBuilds()
}
parameters {
booleanParam defaultValue: false, description: 'Build a release and deploy to web server. Only takes effect on release/* branches.', name: 'RELEASE'
}
environment {
PEDANTIC_FLAGS = "-Wall -pedantic -Werror -O3 -Wno-unknown-pragmas"
CODE_INSTRUMENTATION_FLAGS = "-fstack-protector-strong -fsanitize=address"
}
triggers {
pollSCM '@hourly'
cron '@daily'
}
stages {
stage("OS Build") {
parallel {
stage("FreeBSD amd64") {
agent {
label "freebsd&&amd64"
}
stages {
stage("(FB64) Bootstrap Build") {
steps {
sh "git log --stat > ChangeLog"
dir("libyacurs") {
sh "git log --stat > ChangeLog"
}
sh "touch README NEWS"
sh "autoreconf -I m4 -i"
}
}
stage("(FB64) Configure") {
steps {
dir("obj") {
sh "../configure --enable-debug"
}
}
}
stage("(FB64) Build Docs") {
environment {
PATH = "$PATH:$HOME/.gem/ruby/2.7/bin"
}
steps {
sh 'gem install --user-install asciidoctor'
dir("obj/doc") {
sh '$MAKE -f Makefile.doc'
}
}
}
stage("(FB64) Build") {
steps {
dir("obj") {
sh '$MAKE all CXXFLAGS="${PEDANTIC_FLAGS}"'
}
}
}
stage("(FB64) Test") {
steps {
dir("obj") {
sh '$MAKE check CXXFLAGS="${PEDANTIC_FLAGS}"'
}
}
}
stage("Build distribution") {
when {
branch 'master'
expression { params.RELEASE }
not {
triggeredBy "TimerTrigger"
}
}
steps {
dir("obj") {
sh '$MAKE distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-nls --with-libiconv-prefix=/usr/local --with-libintl-prefix=/usr/local"'
sshagent(['897482ed-9233-4d56-88c3-254b909b6316']) {
sh """sftp [email protected]:/data/www/yapet.guengel.ch/downloads <<EOF
put yapet-*.tar.*
EOF
"""
}
}
}
post {
always {
// If distcheck fails, it leaves certain directories with read-only permissions.
// We unconditionally set write mode
dir("obj") {
sh "chmod -R u+w ."
}
cleanWs notFailBuild: true
}
}
}
}
} // stage("FreeBSD amd64")
stage("Linux") {
agent {
label "linux"
}
stages {
stage("(LX) Bootstrap Build") {
steps {
sh "touch ChangeLog"
dir("libyacurs") {
sh "touch ChangeLog"
}
sh "touch README NEWS"
sh "autoreconf -I m4 -i"
}
}
stage("(LX) Configure") {
steps {
dir("obj") {
sh "../configure --enable-debug"
}
}
}
stage("(LX) Stub Docs") {
steps {
dir("doc") {
sh 'touch csv2yapet.1 yapet.1 yapet2csv.1 yapet_colors.5 yapet_config.5 csv2yapet.html INSTALL.html README.html NEWS.html yapet2csv.html yapet_colors.html yapet_config.html yapet.html'
}
sh 'touch NEWS'
}
}
stage("(LX) Build") {
steps {
dir("obj") {
sh '$MAKE all CXXFLAGS="${PEDANTIC_FLAGS} ${CODE_INSTRUMENTATION_FLAGS}"'
}
}
}
stage("(LX) Test") {
environment {
EXTRA_LD_PRELOAD = "/usr/lib/gcc/x86_64-linux-gnu/10/libasan.so:"
}
steps {
dir("obj") {
sh '$MAKE check CXXFLAGS="${PEDANTIC_FLAGS} ${CODE_INSTRUMENTATION_FLAGS}"'
}
}
}
}
} // stage("Linux")
stage("OpenBSD amd64") {
agent {
label "openbsd&&amd64"
}
stages {
stage("(OB64) Bootstrap Build") {
steps {
sh "touch ChangeLog"
dir("libyacurs") {
sh "touch ChangeLog"
}
sh "touch README NEWS"
sh "autoreconf -I m4 -i"
}
}
stage("(OB64) Configure") {
steps {
dir("obj") {
sh "../configure --enable-debug CC=cc CXX=c++"
}
}
}
stage("(OB64) Stub Docs") {
steps {
dir("doc") {
sh 'touch csv2yapet.1 yapet.1 yapet2csv.1 yapet_colors.5 yapet_config.5 csv2yapet.html INSTALL.html README.html NEWS.html yapet2csv.html yapet_colors.html yapet_config.html yapet.html'
}
}
}
stage("(OB64) Build") {
steps {
dir("obj") {
// OpenBSD 6.4 does not support -fsanitize=address, so no code instrumentation
sh '$MAKE all CXXFLAGS="${PEDANTIC_FLAGS}"'
}
}
}
stage("(OB64) Test") {
steps {
dir("obj") {
// OpenBSD 6.4 does not support -fsanitize=address, so no code instrumentation
sh '$MAKE check CXXFLAGS="${PEDANTIC_FLAGS}"'
}
}
}
}
} // stage("OpenBSD amd64")
} // parallel
} // stage("OS Build")
} // stages
post {
unsuccessful {
mail to: "[email protected]",
subject: "${JOB_NAME} (${BRANCH_NAME};${env.BUILD_DISPLAY_NAME}) -- ${currentBuild.currentResult}",
body: "Refer to ${currentBuild.absoluteUrl}"
}
}
}