forked from Linaro/lite-lava
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
280 lines (251 loc) · 5.24 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
stages:
- test
- analyze
- build
- docker
- deploy
include:
template: SAST.gitlab-ci.yml
###########################
# Templates #
# #
# make sure all jobs use #
# architecture tags. #
###########################
.job: &job
before_script:
- ./.gitlab-ci/$CI_JOB_STAGE/$CI_JOB_NAME.sh setup
dependencies: []
except: [schedules]
tags:
- amd64
script:
- ./.gitlab-ci/$CI_JOB_STAGE/$CI_JOB_NAME.sh
.job_aarch64: &job_aarch64
<<: *job
tags:
- aarch64
.dind: &dind
<<: *job
tags:
- amd64-dind
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
services:
- docker:stable-dind
#######
# Tests
#######
.dispatcher: &dispatcher
<<: *job
stage: test
image: hub.lavasoftware.org/lava/ci-images/amd64/$CI_JOB_NAME
artifacts:
reports:
junit: dispatcher.xml
.server: &server
<<: *job
stage: test
image: hub.lavasoftware.org/lava/ci-images/amd64/$CI_JOB_NAME
artifacts:
reports:
junit:
- common.xml
- server.xml
dispatcher-debian-9: *dispatcher
server-debian-9: *server
dispatcher-debian-10: *dispatcher
server-debian-10: *server
###########
# Analyze #
###########
.analyze: &analyze
<<: *job
stage: analyze
except:
refs:
- tags
black:
<<: *analyze
image: hub.lavasoftware.org/lava/ci-images/amd64/codestyle
codestyle:
<<: *analyze
image: hub.lavasoftware.org/lava/ci-images/amd64/codestyle
coverage:
<<: *analyze
image: hub.lavasoftware.org/lava/ci-images/amd64/server-debian-9
coverage: '/^TOTAL.+ (\d+\.\d+)%$/'
artifacts:
paths:
- htmlcov
only:
refs:
- master
code_quality:
<<: *analyze
image: hub.lavasoftware.org/lava/ci-images/amd64/codestyle
artifacts:
reports:
codequality: gl-code-quality-report.json
pylint:
<<: *analyze
image: hub.lavasoftware.org/lava/ci-images/amd64/codestyle
sast:
stage: analyze
tags:
- amd64-dind
variables:
DOCKER_DRIVER: overlay2
SAST_DEFAULT_ANALYZERS: "bandit"
job-schema:
<<: *analyze
image: debian:buster
#########
# Build #
#########
doc:
<<: *job
stage: build
image: debian:9
artifacts:
paths:
- doc/v2/_build/html
amd64/pkg-debian-9:
<<: *job
stage: build
except: []
image: hub.lavasoftware.org/lava/ci-images/amd64/pkg-debian-9
artifacts:
paths:
- _build/*.deb
# handle native package - need to publish the source
- _build/*.tar.xz
- _build/*.dsc
- _build/*.changes
- _build/*.buildinfo
amd64/pkg-debian-10:
<<: *job
stage: build
except: []
image: hub.lavasoftware.org/lava/ci-images/amd64/pkg-debian-10
artifacts:
paths:
- _build/*.deb
# handle native package - need to publish the source
- _build/*.tar.xz
- _build/*.dsc
- _build/*.changes
- _build/*.buildinfo
aarch64/pkg-debian-10:
<<: *job_aarch64
stage: build
except: []
image: hub.lavasoftware.org/lava/ci-images/aarch64/pkg-debian-10
only:
refs:
- master
- tags
artifacts:
# binary only build, no .dsc or .tar.xz
paths:
- _build/*.deb
- _build/*.changes
- _build/*.buildinfo
aarch64/pkg-debian-9:
<<: *job_aarch64
stage: build
image: hub.lavasoftware.org/lava/ci-images/aarch64/pkg-debian-9
except: []
only:
refs:
- master
- tags
artifacts:
# binary only build, no .dsc or .tar.xz
paths:
- _build/*.deb
- _build/*.changes
- _build/*.buildinfo
##########
# Docker #
##########
.docker: &docker
<<: *dind
stage: docker
dependencies: [amd64/pkg-debian-9]
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE/$CI_JOB_NAME
.docker_aarch64: &docker_aarch64
<<: *docker
only:
refs:
- master
- tags
tags: [aarch64-dind]
dependencies: [aarch64/pkg-debian-10, amd64/pkg-debian-10]
amd64/lava-dispatcher: *docker
amd64/lava-server: *docker
aarch64/lava-dispatcher: *docker_aarch64
aarch64/lava-server: *docker_aarch64
##########
# Deploy #
##########
lavafed-master:
<<: *job
stage: deploy
tags: [deploy]
except: []
only: [schedules]
environment:
name: lavafed-master
url: https://federation.lavasoftware.org/lava/
reprepro-master:
<<: *job
stage: deploy
# Environments and therefore runners are tied to
# a specific branch. You'll see this message:
# "This job is creating a deployment to reprepro-master and
# will overwrite the latest deployment."
tags: [deploy]
dependencies:
- aarch64/pkg-debian-9
- aarch64/pkg-debian-10
- amd64/pkg-debian-9
- amd64/pkg-debian-10
except: []
only: [schedules]
environment:
name: reprepro-master
url: https://apt.lavasoftware.org
reprepro-release:
<<: *job
stage: deploy
# Environments and therefore runners are tied to
# a specific branch. You'll see this message:
# "This job is creating a deployment to reprepro-release and
# will overwrite the latest deployment."
tags: [deploy]
only:
refs:
- tags
dependencies:
- aarch64/pkg-debian-9
- aarch64/pkg-debian-10
- amd64/pkg-debian-9
- amd64/pkg-debian-10
except: [schedules]
environment:
name: reprepro-release
url: https://apt.lavasoftware.org
doc-deploy:
stage: deploy
tags: [deploy]
only:
refs:
- tags
dependencies:
- doc
script:
- mkdir -p ${HOME}/docs/lava
- rsync -av --delete doc/v2/_build/html ${HOME}/docs/lava/