-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy path.gitlab-ci.yml
executable file
·486 lines (447 loc) · 11.9 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
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
# TODO: try to clean up test runs by wrapping go test in a timeout & running
# the cleanup scripts.
# I think we'll need to pass in a name to the test runner, and then cleanup
# anything with that prefix...
variables:
SERVER_NAME: dotmesh-server
RELEASE_DOCKER_REGISTRY: quay.io
RELEASE_DOCKER_REPOSITORY: dotmesh
CI_SERVICE_BEING_TESTED: dotmesh
DOTMESH_TEST_CLEANUP: later
DOTMESH_TEST_TIMEOUT: 10m
stages:
- build
- deploy_images
- test
- deploy
- manual_deploy
- notify
before_script:
- mkdir -p gopath
- export GOPATH=$(pwd)/gopath
- cd gopath
- mkdir -p src/github.com/dotmesh-io
- ln -s `realpath ..` ./src/github.com/dotmesh-io/dotmesh
- cd src/github.com/dotmesh-io/dotmesh
- while [ -f /dotmesh-test-cleanup.lock ]; do echo "waiting for test cleanup..."; sleep 1; done
build_client_linux:
retry: 2
stage: build
tags:
- fast
script:
- export DOCKER_TAG=${CI_COMMIT_TAG:-${CI_COMMIT_SHA:-latest}}
- export VERSION=$DOCKER_TAG # todo could change this to a "short" sha if needed
- make build_client
artifacts:
paths:
- binaries
expire_in: 1 week
build_client_macos:
retry: 2
stage: build
tags:
- fast
script:
- export DOCKER_TAG=${CI_COMMIT_TAG:-${CI_COMMIT_SHA:-latest}}
- export VERSION=$DOCKER_TAG # todo could change this to a "short" sha if needed
- make build_client_mac
artifacts:
paths:
- binaries
expire_in: 1 week
build_yaml:
retry: 2
stage: build
tags:
- fast
script:
- (cd kubernetes && ./rebuild.sh)
artifacts:
paths:
- yaml
expire_in: 1 week
build_operator:
retry: 2
stage: build
tags:
- fast
script:
- export DOCKER_TAG=${CI_COMMIT_TAG:-${CI_COMMIT_SHA:-latest}}
- export VERSION=$DOCKER_TAG # todo could change this to a "short" sha if needed
- export REPOSITORY=${CI_REGISTRY}/${CI_PROJECT_PATH}/
- make build_push_operator
build_provisioner:
retry: 2
stage: build
tags:
- fast
script:
- export DOCKER_TAG=${CI_COMMIT_TAG:-${CI_COMMIT_SHA:-latest}}
- export VERSION=$DOCKER_TAG # todo could change this to a "short" sha if needed
- export REPOSITORY=${CI_REGISTRY}/${CI_PROJECT_PATH}/
- make build_push_provisioner
build_server:
retry: 2
stage: build
tags:
- fast
script:
- export DOCKER_TAG=${CI_COMMIT_TAG:-${CI_COMMIT_SHA:-latest}}
- export VERSION=$DOCKER_TAG # todo could change this to a "short" sha if needed
- export REPOSITORY=${CI_REGISTRY}/${CI_PROJECT_PATH}/
- make build_push_server
dotmesh_unit_tests:
stage: test
tags:
- fast
script:
- sudo -E go test `go list ./... | egrep -v /tests | egrep -v /cmd`
# run full dind tests on linux
linux_default_dot:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestDefaultDot
artifacts:
paths:
- extracted_logs
when: always
linux_dot_diff:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestDotDiff
artifacts:
paths:
- extracted_logs
when: always
linux_dot_last_modified:
retry: 1
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestGetLastModifiedTimeForDot
artifacts:
paths:
- extracted_logs
when: always
linux_boltdb:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestBoltDBStoreWithDefaultDot
artifacts:
paths:
- extracted_logs
when: always
linux__restart_boltdb:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestRecoverFromUnmountedDotOnMasterBoltDB
artifacts:
paths:
- extracted_logs
when: always
linux_single_node:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestSingleNode
artifacts:
paths:
- extracted_logs
when: always
linux_recover_from_unmounted_dot_on_master:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestRecoverFromUnmountedDotOnMaster
artifacts:
paths:
- extracted_logs
when: always
linux_two_nodes_same_cluster:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestTwoNodesSameCluster
artifacts:
paths:
- extracted_logs
when: always
linux_deletion_simple:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
allow_failure: true
script:
- bash ./scripts/test.sh -run TestDeletionSimple
artifacts:
paths:
- extracted_logs
when: always
linux_deletion_complex:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestDeletionComplex
artifacts:
paths:
- extracted_logs
when: always
linux_backup_and_restore_two_single_node_clusters:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestBackupAndRestoreTwoSingleNodeClusters
artifacts:
paths:
- extracted_logs
when: always
linux_two_single_node_clusters:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestTwoSingleNodeClusters
artifacts:
paths:
- extracted_logs
when: always
linux_three_single_node_clusters:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestThreeSingleNodeClusters
artifacts:
paths:
- extracted_logs
when: always
linux_two_double_node_clusters:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestTwoDoubleNodeClusters
artifacts:
paths:
- extracted_logs
when: always
.linux_s3remote:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestS3Remote
artifacts:
paths:
- extracted_logs
when: always
linux_s3api:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestS3Api
artifacts:
paths:
- extracted_logs
when: always
linux_external_user_manager:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestExternalUserManager
artifacts:
paths:
- extracted_logs
when: always
linux_forks:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- bash ./scripts/test.sh -run TestForks
artifacts:
paths:
- extracted_logs
when: always
linux_stress_lots_of_commits:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- DOTMESH_TEST_TIMEOUT=30m bash ./scripts/test.sh -timeout 30m -run TestStressLotsOfCommits
artifacts:
paths:
- extracted_logs
when: always
when: manual
linux_stress_large_files:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- big-disk
- fast
script:
- DOTMESH_TEST_TIMEOUT=30m bash ./scripts/test.sh -timeout 30m -run TestStressLargeFiles
artifacts:
paths:
- extracted_logs
when: always
when: manual
linux_stress_handover:
retry: 2
stage: test
dependencies:
- build_client_linux
tags:
- fast
script:
- DOTMESH_TEST_TIMEOUT=30m bash ./scripts/test.sh -timeout 30m -run TestStressHandover
artifacts:
paths:
- extracted_logs
when: always
when: manual
publish_images:
stage: deploy_images
dependencies:
- build_client_linux
- build_client_macos
- build_server
- build_yaml
tags:
- fast
script:
# push to quay.io, by re-tagging and pushing the images
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker login -u $QUAY_USER -p $QUAY_PASSWORD $RELEASE_DOCKER_REGISTRY
- export REPOSITORY=$RELEASE_DOCKER_REGISTRY/$RELEASE_DOCKER_REPOSITORY/
- export DOCKER_TAG=${CI_COMMIT_TAG:-$CI_COMMIT_SHA}
- export VERSION=$DOCKER_TAG
- make release_all
- export DOCKER_TAG=$CI_BUILD_REF_NAME
- export VERSION=$DOCKER_TAG
- make release_all
except:
- schedules
trigger_e2e_firecracker_test:
stage: deploy
tags:
- fast
script:
- echo - curl -X POST -F "token=$CI_JOB_TOKEN" -F "ref=master" -F "variables[CI_SERVICE_BEING_TESTED]=$CI_SERVICE_BEING_TESTED" -F "variables[CI_DOCKER_TAG]=${CI_COMMIT_TAG:-${CI_COMMIT_SHA:-latest}}" -F "variables[DOTMESH_CI_BUILD_REF_NAME]=$CI_BUILD_REF_NAME" https://gitlab.dotmesh.com/api/v4/projects/dotmesh%2Fe2e-firecracker-sync/trigger/pipeline
- curl -X POST -F "token=$CI_JOB_TOKEN" -F "ref=master" -F "variables[CI_SERVICE_BEING_TESTED]=$CI_SERVICE_BEING_TESTED" -F "variables[CI_DOCKER_TAG]=${CI_COMMIT_TAG:-${CI_COMMIT_SHA:-latest}}" -F "variables[DOTMESH_CI_BUILD_REF_NAME]=$CI_BUILD_REF_NAME" https://gitlab.dotmesh.com/api/v4/projects/dotmesh%2Fe2e-firecracker-sync/trigger/pipeline
only:
- master
deploy_unstable_build:
stage: deploy
dependencies:
- build_client_linux
- build_client_macos
- build_yaml
- publish_images
tags:
- fast
script:
- "ssh -o UserKnownHostsFile=./release-hosts [email protected] mkdir -p /pool/releases/unstable/$CI_COMMIT_REF_NAME"
- "rsync -e 'ssh -o UserKnownHostsFile=./release-hosts' -avz binaries/{Linux,Darwin} yaml [email protected]:/pool/releases/unstable/$CI_COMMIT_REF_NAME"
- "echo \"Deployed to https://get.dotmesh.io/unstable/$CI_COMMIT_REF_NAME\""
except:
- /^release-.*$/
deploy_release_build:
stage: deploy
dependencies:
- build_client_linux
- build_client_macos
- build_yaml
- publish_images
tags:
- fast
script:
- VERSION=`cd cmd/versioner; go run versioner.go`; echo VERSION=$VERSION
- "ssh -o UserKnownHostsFile=./release-hosts [email protected] mkdir -p /pool/releases/$VERSION"
- "rsync -e 'ssh -o UserKnownHostsFile=./release-hosts' -avz binaries/{Linux,Darwin} yaml [email protected]:/pool/releases/$VERSION"
only:
- /^release-.*$/
mark_release_as_stable:
stage: manual_deploy
script:
- VERSION=`cd cmd/versioner; go run versioner.go`
- "ssh -o UserKnownHostsFile=./release-hosts [email protected] sh -c \"true && rm -f /pool/releases/Linux && ln -s $VERSION/Linux /pool/releases && rm -f /pool/releases/Darwin && ln -s $VERSION/Darwin /pool/releases && rm -f /pool/releases/yaml && ln -fs $VERSION/yaml /pool/releases\""
only:
- /^release-.*$/
when: manual