This repository has been archived by the owner on Oct 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
387 lines (314 loc) · 13.1 KB
/
.gitlab-ci.yml
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
stages:
- initial_report
- build
- publish_build
- test
- final_report
variables:
GITHUB_REPO_API_URL: "https://api.github.com/repos/ipbus/ipbus-software"
IPBUS_DOCKER_REGISTRY: "gitlab-registry.cern.ch/ipbus/ipbus-docker"
OUTPUT_ROOT_DIR: "/eos/user/i/ipbusci/sw-gitlab-ci"
OUTPUT_ROOT_URL: "http://www.cern.ch/ipbus/sw/ci"
.job_template: &github_commit_status_jobTemplate
image: cern/cc7-base:20170113
tags:
- docker
except:
- tags
dependencies: []
github_commit_status:start:
<<: *github_commit_status_jobTemplate
stage: initial_report
when: always
script:
- "curl -H \"Authorization: token ${GITHUB_STATUS_TOKEN}\" --data '{\"state\" : \"pending\", \"target_url\" : \"'\"${CI_PROJECT_URL}\"'/pipelines/'\"${CI_PIPELINE_ID}\"'\", \"description\" : \"CI pipeline has started\", \"context\" : \"gitlab-ci\"}' ${GITHUB_REPO_API_URL}/statuses/${CI_BUILD_REF}"
github_commit_status:end:failure:
<<: *github_commit_status_jobTemplate
stage: final_report
when: on_failure
script:
- "curl -H \"Authorization: token ${GITHUB_STATUS_TOKEN}\" --data '{\"state\" : \"failure\", \"target_url\" : \"'\"${CI_PROJECT_URL}\"'/pipelines/'\"${CI_PIPELINE_ID}\"'\", \"description\" : \"Jobs have failed in CI pipeline\", \"context\" : \"gitlab-ci\"}' ${GITHUB_REPO_API_URL}/statuses/${CI_BUILD_REF}"
github_commit_status:end:success:
<<: *github_commit_status_jobTemplate
stage: final_report
when: on_success
script:
- "curl -H \"Authorization: token ${GITHUB_STATUS_TOKEN}\" --data '{\"state\" : \"success\", \"target_url\" : \"'\"${CI_PROJECT_URL}\"'/pipelines/'\"${CI_PIPELINE_ID}\"'\", \"description\" : \"CI pipeline completed successfully!\", \"context\" : \"gitlab-ci\"}' ${GITHUB_REPO_API_URL}/statuses/${CI_BUILD_REF}"
doxygen_job:
stage: build
image: ${IPBUS_DOCKER_REGISTRY}/ipbus-sw-doxygen:2019-01-08__doxygen1.8.14
tags:
- docker
script:
- env | grep -v PASSWORD | grep -v TOKEN
- ./scripts/doxygen/api_uhal.sh "(${CI_COMMIT_TAG:-commit ${CI_COMMIT_SHA}})"
- ls -al /tmp
- mkdir -p ${CI_PROJECT_DIR}/ci_build_results/
- mv /tmp/api_uhal ${CI_PROJECT_DIR}/ci_build_results/api_uhal
artifacts:
paths:
- ci_build_results/api_uhal
when: always
expire_in: 1 day
.job_template: &build_rpm_yumrepo_jobTemplate
stage: build
tags:
- docker
before_script:
- export REPO_DIR=${CI_PROJECT_DIR}/ci_build_results/repos/${OUTPUT_REPO_SUBDIR}
- if [ -z "${CI_COMMIT_TAG}" ]; then export PACKAGE_RELEASE_SUFFIX=.autobuild_$(git log --pretty=format:'%h' -1) ; fi
script:
- env | grep -v PASSWORD | grep -v TOKEN
- cd .. && sudo rm -rf ipbus-software___ && mv ipbus-software ipbus-software___ && mkdir ipbus-software && cd ipbus-software___
- make -k Set=all
- make -k Set=all PACKAGE_RELEASE_SUFFIX=${PACKAGE_RELEASE_SUFFIX} rpm
- mkdir -p ${REPO_DIR}
- make -C uhal/log generate_files
- git diff --exit-code
- cp `find . -iname "*.rpm"` ${REPO_DIR} && cp ${YUMGROUPS_FILE} ${REPO_DIR}/yumgroups.xml
- ls ${REPO_DIR}
- createrepo -vg yumgroups.xml ${REPO_DIR}
artifacts:
paths:
- ci_build_results/repos/${OUTPUT_REPO_SUBDIR}
when: always
expire_in: 1 day
build:slc6:
<<: *build_rpm_yumrepo_jobTemplate
image: ${IPBUS_DOCKER_REGISTRY}/ipbus-sw-dev-slc6:2019-01-08
variables:
YUMGROUPS_FILE: "ci/yumgroups-slc6.xml"
OUTPUT_REPO_SUBDIR: "slc6_x86_64"
build:centos7:
<<: *build_rpm_yumrepo_jobTemplate
image: ${IPBUS_DOCKER_REGISTRY}/ipbus-sw-dev-cc7:2019-01-08__boost1.53.0_pugixml1.8
variables:
YUMGROUPS_FILE: "ci/yumgroups-centos7.xml"
OUTPUT_REPO_SUBDIR: "centos7_x86_64"
.job_template: &simple_build_jobTemplate
stage: build
tags:
- docker
script:
- env | grep -v PASSWORD | grep -v TOKEN
- make -k Set=all
artifacts:
untracked: true
when: always
expire_in: 1 day
build:fedora30-python2:
<<: *simple_build_jobTemplate
image: ${IPBUS_DOCKER_REGISTRY}/ipbus-sw-dev-fedora30-python2:2019-10-12__erlang21.3_gcc9.2.1_boost1.69.0_pugixml1.9
build:fedora30-python3:
<<: *simple_build_jobTemplate
image: ${IPBUS_DOCKER_REGISTRY}/ipbus-sw-dev-fedora30-python3:2019-10-12__erlang21.3_gcc9.2.1_boost1.69.0_pugixml1.9
build:ubuntu16:
<<: *simple_build_jobTemplate
image: ${IPBUS_DOCKER_REGISTRY}/ipbus-sw-dev-ubuntu16:2019-01-08__erlang18.3_gcc5.3.1_boost1.58.0_pugixml1.7
publish_build_job:
stage: publish_build
image: gitlab-registry.cern.ch/ci-tools/ci-web-deployer:latest
variables:
CI_OUTPUT_DIR: "ci_build_results/"
before_script:
- yum -y install openssh-clients
- export EOS_PATH=${OUTPUT_ROOT_DIR}/commits/${CI_COMMIT_TAG:-${CI_COMMIT_SHA}}/pipeline${CI_PIPELINE_ID}
- if [ -n "${CI_COMMIT_TAG}" ]; then export EOS_PATH=${EOS_PATH/commits/tags} ; fi
script:
- env | grep -v PASSWORD | grep -v TOKEN | sort
- echo "${EOS_ACCOUNT_PASSWORD}" | kinit ${EOS_ACCOUNT_USERNAME}@CERN.CH
- klist
- ssh -F ${CI_PROJECT_DIR}/ci/ssh_config ${EOS_ACCOUNT_USERNAME}@lxplus "rm -rf ${EOS_PATH} && mkdir -p ${EOS_PATH}"
- ssh -F ${CI_PROJECT_DIR}/ci/ssh_config ${EOS_ACCOUNT_USERNAME}@lxplus "ln -sfnv ${EOS_PATH} `dirname ${EOS_PATH}`/latest"
- kdestroy
- ls -lt ${CI_OUTPUT_DIR}
- deploy-eos
.job_template: &rpmInstall_test_jobTemplate
stage: test
dependencies: []
before_script:
- export OUTPUT_PIPELINE_URL=${OUTPUT_ROOT_URL}/commits/${CI_COMMIT_TAG:-${CI_COMMIT_SHA}}/pipeline${CI_PIPELINE_ID}
- if [ -n "${CI_COMMIT_TAG}" ]; then export OUTPUT_PIPELINE_URL=${OUTPUT_PIPELINE_URL/commits/tags} ; fi
- sudo cp ci/ipbus-sw-ci.repo /etc/yum.repos.d/ipbus-sw-ci.repo
- sudo sed -i -re "s|^baseurl=.*|baseurl=${OUTPUT_PIPELINE_URL}/repos/${REPO_URL_OS_SUBDIR}|g" /etc/yum.repos.d/ipbus-sw-ci.repo
- cat /etc/yum.repos.d/ipbus-sw-ci.repo
- sudo rpm --rebuilddb && sudo yum clean all
- sudo yum -y groupinstall ipbus-sw
- sudo yum -y install 'cactuscore-uhal-*-debuginfo'
- rpm -qa | grep cactus | sort
.job_template: &slc6_test_jobTemplate
<<: *rpmInstall_test_jobTemplate
image: ${IPBUS_DOCKER_REGISTRY}/ipbus-sw-test-slc6:2019-01-08
variables:
REPO_URL_OS_SUBDIR: slc6_x86_64
UHAL_ENABLE_IPBUS_PCIE: ""
UHAL_GUI_DEPENDENCIES: "wxPython numpy"
VALGRIND_ARGS: "--suppressions=/opt/cactus/etc/uhal/tests/valgrind/uhal_tests_slc6.supp"
.job_template: ¢os7_test_jobTemplate
<<: *rpmInstall_test_jobTemplate
image: ${IPBUS_DOCKER_REGISTRY}/ipbus-sw-test-cc7:2019-01-08
variables:
REPO_URL_OS_SUBDIR: centos7_x86_64
UHAL_ENABLE_IPBUS_PCIE: ""
TEST_SUITE_CONTROLHUB_PATH_ARGUMENT: "-p /opt/cactus/bin"
UHAL_GUI_DEPENDENCIES: "wxPython numpy"
VALGRIND_ARGS: "--suppressions=/opt/cactus/etc/uhal/tests/valgrind/uhal_tests.supp"
.job_template: &simpleInstall_test_jobTemplate
stage: test
before_script:
- sudo make -k Set=all install
- ls -al /opt/cactus /opt/cactus/*
- export TEST_SUITE_CONTROLHUB_PATH_ARGUMENT="-p /opt/cactus/bin"
.job_template: &fedora30_python2_test_jobTemplate
<<: *simpleInstall_test_jobTemplate
image: ${IPBUS_DOCKER_REGISTRY}/ipbus-sw-dev-fedora30-python2:2019-10-12__erlang21.3_gcc9.2.1_boost1.69.0_pugixml1.9
dependencies:
- build:fedora30-python2
variables:
UHAL_ENABLE_IPBUS_PCIE: ""
UHAL_GUI_DEPENDENCIES: "wxPython numpy"
VALGRIND_ARGS: "--suppressions=/opt/cactus/etc/uhal/tests/valgrind/uhal_tests.supp"
.job_template: &fedora30_python3_test_jobTemplate
<<: *simpleInstall_test_jobTemplate
image: ${IPBUS_DOCKER_REGISTRY}/ipbus-sw-dev-fedora30-python3:2019-10-12__erlang21.3_gcc9.2.1_boost1.69.0_pugixml1.9
dependencies:
- build:fedora30-python3
variables:
UHAL_ENABLE_IPBUS_PCIE: ""
UHAL_GUI_DEPENDENCIES: python3-wxpython4
VALGRIND_ARGS: "--suppressions=/opt/cactus/etc/uhal/tests/valgrind/uhal_tests.supp"
.job_template: &ubuntu16_test_jobTemplate
<<: *simpleInstall_test_jobTemplate
image: ${IPBUS_DOCKER_REGISTRY}/ipbus-sw-dev-ubuntu16:2019-01-08__erlang18.3_gcc5.3.1_boost1.58.0_pugixml1.7
dependencies:
- build:ubuntu16
variables:
UHAL_ENABLE_IPBUS_PCIE: ""
VALGRIND_ARGS: "--suppressions=/opt/cactus/etc/uhal/tests/valgrind/uhal_tests.supp"
.job_template: &test_core_jobTemplate
tags:
- docker
- docker-cap-net-admin
script:
- export PATH=/opt/cactus/bin:/opt/cactus/bin/uhal/tests:$PATH
- export LD_LIBRARY_PATH=/opt/cactus/lib:$LD_LIBRARY_PATH
- env | grep -v PASSWORD | grep -v TOKEN
- /opt/cactus/bin/controlhub_status || service controlhub start || /opt/cactus/bin/controlhub_start
- run_uhal_tests.exe -c file:///opt/cactus/etc/uhal/tests/dummy_connections.xml --log_level=test_suite
- service controlhub stop || /opt/cactus/bin/controlhub_stop
- uhal_test_suite.py -v -s "2.0 controlhub - light packet loss" ${TEST_SUITE_CONTROLHUB_PATH_ARGUMENT}
- valgrind --error-exitcode=1 --tool=memcheck --leak-check=full --run-libc-freeres=no ${VALGRIND_ARGS} run_uhal_tests.exe -c file:///opt/cactus/etc/uhal/tests/dummy_connections.xml --t 10000 --quick --run_test=ipbusudp* --log_level=test_suite
.job_template: &test_python_jobTemplate
tags:
- docker
script:
- export PATH=/opt/cactus/bin/uhal/tests:$PATH
- export LD_LIBRARY_PATH=/opt/cactus/lib:$LD_LIBRARY_PATH
- env | grep -v PASSWORD | grep -v TOKEN
- uhal_test_suite.py -v -s pycohal
.job_template: &test_gui_jobTemplate
tags:
- docker
script:
- 'if [ -x "$(command -v yum)" ]; then sudo yum -y install ${UHAL_GUI_DEPENDENCIES} ; else sudo apt-get update && sudo apt-get -y install python-wx* ; fi'
- export PATH=/opt/cactus/bin/uhal/tests:$PATH
- export LD_LIBRARY_PATH=/opt/cactus/lib:$LD_LIBRARY_PATH
- env | grep -v PASSWORD | grep -v TOKEN
- uhal_test_suite.py -v -s gui
.job_template: &test_tools_jobTemplate
tags:
- docker
script:
- export PATH=/opt/cactus/bin/uhal/tests:/opt/cactus/bin/uhal/tools:$PATH
- export LD_LIBRARY_PATH=/opt/cactus/lib:$LD_LIBRARY_PATH
- env | grep -v PASSWORD | grep -v TOKEN
- uhal_test_suite.py -v -s tools
.job_template: &test_controlhub_service_jobTemplate
tags:
- docker
script:
- env | grep -v PASSWORD | grep -v TOKEN
- /sbin/service controlhub stop
- 'for i in `seq 1 50`; do /sbin/service controlhub start; if [ "$?" != "0" ]; then echo "ERROR IN STARTING CONTROLHUB"; fi; /sbin/service controlhub status; if [ "$?" != "0" ]; then echo "ERROR: CONTROLHUB SHOULD HAVE ALREADY STARTED"; fi; /sbin/service controlhub stop; done'
.job_template: &test_controlhub_plainScripts_jobTemplate
tags:
- docker
script:
- env | grep -v PASSWORD | grep -v TOKEN
- /opt/cactus/bin/controlhub_stop || true
- 'for i in `seq 1 50`; do /opt/cactus/bin/controlhub_start; if [ "$?" != "0" ]; then echo "ERROR IN STARTING CONTROLHUB"; fi; /opt/cactus/bin/controlhub_status; if [ "$?" != "0" ]; then echo "ERROR: CONTROLHUB SHOULD HAVE ALREADY STARTED"; fi; /opt/cactus/bin/controlhub_stop; done'
test_core:slc6:
<<: *slc6_test_jobTemplate
<<: *test_core_jobTemplate
test_python:slc6:
<<: *slc6_test_jobTemplate
<<: *test_python_jobTemplate
test_gui:slc6:
<<: *slc6_test_jobTemplate
<<: *test_gui_jobTemplate
test_tools:slc6:
<<: *slc6_test_jobTemplate
<<: *test_tools_jobTemplate
test_controlhub:slc6:
<<: *slc6_test_jobTemplate
<<: *test_controlhub_service_jobTemplate
test_core:centos7:
<<: *centos7_test_jobTemplate
<<: *test_core_jobTemplate
test_python:centos7:
<<: *centos7_test_jobTemplate
<<: *test_python_jobTemplate
test_gui:centos7:
<<: *centos7_test_jobTemplate
<<: *test_gui_jobTemplate
test_tools:centos7:
<<: *centos7_test_jobTemplate
<<: *test_tools_jobTemplate
test_controlhub:centos7:
<<: *centos7_test_jobTemplate
<<: *test_controlhub_plainScripts_jobTemplate
test_core:fedora30-python2:
<<: *fedora30_python2_test_jobTemplate
<<: *test_core_jobTemplate
test_python:fedora30-python2:
<<: *fedora30_python2_test_jobTemplate
<<: *test_python_jobTemplate
test_gui:fedora30-python2:
<<: *fedora30_python2_test_jobTemplate
<<: *test_gui_jobTemplate
test_tools:fedora30-python2:
<<: *fedora30_python2_test_jobTemplate
<<: *test_tools_jobTemplate
test_controlhub:fedora30-python2:
<<: *fedora30_python2_test_jobTemplate
<<: *test_controlhub_plainScripts_jobTemplate
test_core:fedora30-python3:
<<: *fedora30_python3_test_jobTemplate
<<: *test_core_jobTemplate
test_python:fedora30-python3:
<<: *fedora30_python3_test_jobTemplate
<<: *test_python_jobTemplate
test_gui:fedora30-python3:
<<: *fedora30_python3_test_jobTemplate
<<: *test_gui_jobTemplate
test_tools:fedora30-python3:
<<: *fedora30_python3_test_jobTemplate
<<: *test_tools_jobTemplate
test_controlhub:fedora30-python3:
<<: *fedora30_python3_test_jobTemplate
<<: *test_controlhub_plainScripts_jobTemplate
test_core:ubuntu16:
<<: *ubuntu16_test_jobTemplate
<<: *test_core_jobTemplate
test_python:ubuntu16:
<<: *ubuntu16_test_jobTemplate
<<: *test_python_jobTemplate
test_gui:ubuntu16:
<<: *ubuntu16_test_jobTemplate
<<: *test_gui_jobTemplate
test_tools:ubuntu16:
<<: *ubuntu16_test_jobTemplate
<<: *test_tools_jobTemplate
test_controlhub:ubuntu16:
<<: *ubuntu16_test_jobTemplate
<<: *test_controlhub_plainScripts_jobTemplate